I've seen a few programs (eg Charles Web Developer Proxy) that are able to modify Firefox's proxy settings. The sequence is:
- Firefox is running, with the users proxy settings.
- User starts the external third party application, which
- modifies Firefox's proxy settings, and then
- the user exits the third party program and,
- Firefox resumes running with its original proxy settings.
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:
- Write a new user preferences config file and start a new instance of the browser. Would work but not quite right -- Charles for example can modify the settings of an already running browser and restore them without restarting.
- Write a plug-in. Could write a Firefox plugin that offered some kind of IPC to the outside and then handled the Firefox preference setting itself. In fact, I think this might be the only way. Disabling Charles' Firefox plug-in seems to disable its ability to modify preferences on the fly.
Possible Resources
- Programatically changing Firefox preferences: Preferences - MDC
- Building Firefox Extensions: Extensions - MDC