FireFox Homepage
Posted: Tue Sep 08, 2009 6:42 pm
I need change homepage in firefox browser and i have problem:
Its not work
write in different line 
Code: Select all
Procedure.s FindFile(file.s, directory.s, recursive = 1)
PathAddBackslash_(@directory)
Protected result.s, dir = ExamineDirectory(#PB_Any, directory, file)
If dir And NextDirectoryEntry(dir)
result = directory + DirectoryEntryName(dir)
FinishDirectory(dir)
ElseIf recursive
dir = ExamineDirectory(#PB_Any, directory, "")
If dir
While NextDirectoryEntry(dir) And Not result
If DirectoryEntryType(dir) = #PB_DirectoryEntry_Directory And DirectoryEntryName(dir)<>"." And DirectoryEntryName(dir)<>".."
result = FindFile(file, directory + DirectoryEntryName(dir), 1)
EndIf
Wend
FinishDirectory(dir)
EndIf
EndIf
ProcedureReturn result
EndProcedure
Result$ = GetHomeDirectory()
optionspath.s = FindFile("prefs.js", Result$ + "Application Data\Mozilla\Firefox\Profiles\", 1)
If OpenFile(1, optionspath.s)
While Eof(1) = 0
A$ = ReadString(1)
posit.l = FindString(A$, "user_pref(" + Chr(34) + "browser.startup.homepage" + Chr(34) + "", 0)
If posit.l>0
B$ = "user_pref(" + Chr(34) + "browser.startup.homepage" + Chr(34) + "," + Chr(34) + "http://www.yan.ru/" + Chr(34) + ");"
WriteString(1, B$)
EndIf
Debug A$
Wend
CloseFile(1)
EndIf