Archive: edit firefox homepage


edit firefox homepage
i am trying to set my website as the firefox/chrome homepage.
i there any possible way doing it?


Firefox home page is stored in a TXT file with the extension ".js", you can edit this to set the homepage. But if firefox is running, even written, once you close firefox, it will still be overwritten to store configuration.

ReadINIStr $0 "$APPDATA\Mozilla\Firefox\profiles.ini" Profile0 IsRelative
ReadINIStr $1 "$APPDATA\Mozilla\Firefox\profiles.ini" Profile0 Path
${If} $0 = 1
${WordReplace} $1 "/" "\" + $1
StrCpy $R0 "$APPDATA\Mozilla\Firefox\$1\prefs.js"
${ElseIf} $0 = 0
StrCpy $R0 "$1\prefs.js"
${EndIf}

$R0 stores the full path of Firefox configuration "prefs.js". You can then use ${LineFind}, ${WordFind2X}, ${WordReplace} etc. to replace the site in such line with your site:
user_pref("browser.startup.homepage", "http://www.google.com/");

Chrome is also similar, but I hardly use it. You must search and modify the profile yourself. It is stored in the file "Preferences" in $LocalAppData\Google\Chrome\User Data\Default directory.


thx man.
one more question .. i have no problem tracing this line but i problem replacing the url that comes after user_pref("browser.startup.homepage", which every time is different.
how can i locate this line specifically(he has difficulty stocking the whole string because of the double "" and etc) and replace only the second part of this sentence(the url part).


To quote quotationmarks, use ` or ' quotes. To get part of a string, use StrCpy. To put the parts back together, simply concatenate them: '$firstpart$secondpart'


For example:

#Find each line
${LineFind} "$R0" "" "1:-1" "LineRead"

Function LineRead
# Check if string "browser.startup.homepage" exists in this line
System::Call `shlwapi::StrStr(tR9,t'"browser.startup.homepage"')i.r0`
IntCmp $0 0 next
${WordFind2X} $R9 `"` `"` -1 $0
${WordReplace} $R9 `$0` `http://www.yoursite.com/` "+*" $R9
next:
Push $0
FunctionEnd


thx alot guys