Jump to content

Firefox Proxy Settings Script


pierlo
 Share

Recommended Posts

Hallo all, this is my first post.

I looked allover the place for someone else's submission regarding this topic but i haven't found any. So here's my suggestion to automate Firefox Http Proxy settings.

The basics:

  • This is the first time you launch Firefox
  • We wait untile the profile folder is created
  • We find the random string id for your current profile
  • We copy the prefs.js file containing the settings we need
And here comes the (not bulletproof yet) code:

Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe")
Sleep(15000) ; so that if it's the first time the program is executed, we wait untile the profile folder is created
;~ Read from Firefox's profile file where is the current user's preferences file stored
;~ Path=Profiles/h93zdl03.default
$line = FileReadLine(@AppDataDir & "\Mozilla\Firefox\profiles.ini", 7) ; line 7 contains the random string associated with the profile
;~ and save it to $path
$path = StringTrimLeft($line, 14)

$from = "prefs.js" ; file with desired settings taken from a profile
$to = @AppDataDir & "\Mozilla\Firefox\Profiles\" & $path & "\prefs.js"
;~ Copy the INGV prefs.js (same level as this script) to the user's profile folder
FileCopy($from, $to, 1)
;~ Done!

Exit

Feel free to suggest better lines....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...