I am currently trying to port a chrome extension to firefox (addon-sdk). However I came up with a few problems porting the pac script functionality.
When setting a proxy through chromes extension API, you can set a PAC script as string inside the pac script object (ref: http://developer.chrome.com/extensions/proxy.html#type-PacScript)
Looking in Firefox, there is nothing like that. The only option I see is to pull the script from a url (http://kb.mozillazine.org/Firefox_:FAQs:_About:config_Entries). My problem with this is that the pac script have to change and react when the user adjust addon settings.
Is there a (hacky) way to accomplish something like that in Firefox?
The only solution I came up with is encoding the users options and post them to the pac script server. Server parses them and creates a script matching the needs. I want to avoid using servers at any costs as this results in another dependency!
You can use a data: URI for your PAC file. Generating it dynamically is easy: