FireFox Homepage

Just starting out? Need help? Post your questions and find answers here.
besko
User
User
Posts: 42
Joined: Tue Oct 28, 2008 1:08 pm

FireFox Homepage

Post by besko »

I need change homepage in firefox browser and i have problem:

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
Its not work :( write in different line :(
Little John
Addict
Addict
Posts: 4843
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Post by Little John »

Unfortunately it's not that easy ...

I'm ignoring the FindFile() stuff now, since that doesn't seem to be your problem.
Assuming you know where your desired file is, so you have its complete pathname, you can use this procedure ReplaceLine().

Regards, Little John
Post Reply