I've seen a few programs (eg Charles Web Developer Proxy) that are able to modify Firefox's proxy settings. The sequence is:
Assuming the external application is remembering the old proxy settings and restoring them on exit how can I read and write Firefox's proxy settings? Have tried Googling through the Firefox doco but no luck yet.
Options Considered:
Possible Resources
From what I could see from the documentation, Charles has a matching Firefox extension which it installs/uses. That may be how it can reload the proxy information on the fly.
Proxy information is stored in your profile's prefs.js, but that can't be reloaded on the fly. Firefox reads from it on startup and writes to it when it shuts down, and does not load from it in between. Also, if Firefox is running when you edit prefs.js, your changes will be overwritten.
I thought you might be able to do something with a PAC file, but after digging around a bit, I've found that it doesn't seem to be reloaded on the fly either. You'd have to restart to reload any modifications to the settings.