Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Learn More

Firefox plugin for changing proxy

  • 2 odpovede
  • 2 majú tento problém
  • 5 zobrazení
  • Posledná odpoveď od cor-el

more options

I need to make plugin for FireFox which could change proxy in user browser. I checked Firefox docs for developers and write something like that:

var prefsvc = require("sdk/preferences/service"); prefsvc.set("network.proxy.http", server); prefsvc.set("network.proxy.http_port", port); prefsvc.set("network.proxy.ssl", server); prefsvc.set("network.proxy.ssl_port", port); prefsvc.set("network.proxy.type", 1);

As a result my proxy settings in browser was updated in a menu->settings->network->proxy, but i have a strange bug, untill i dont press OK in that settings menu, my ip dosent change, so services in Mozilla have changed, but proxy still not work. After pressing OK in that menu once, all work correctly. Can I change and save that settings only using JS code, without user apply in menu? Hope for your help.

https://imgur.com/a/O5msz

I need to make plugin for FireFox which could change proxy in user browser. I checked Firefox docs for developers and write something like that: var prefsvc = require("sdk/preferences/service"); prefsvc.set("network.proxy.http", server); prefsvc.set("network.proxy.http_port", port); prefsvc.set("network.proxy.ssl", server); prefsvc.set("network.proxy.ssl_port", port); prefsvc.set("network.proxy.type", 1); As a result my proxy settings in browser was updated in a menu->settings->network->proxy, but i have a strange bug, untill i dont press OK in that settings menu, my ip dosent change, so services in Mozilla have changed, but proxy still not work. After pressing OK in that menu once, all work correctly. Can I change and save that settings only using JS code, without user apply in menu? Hope for your help. https://imgur.com/a/O5msz

Všetky odpovede (2)

more options

NPAPI Plugins are basically dead in Firefox; the only one that is allowed now is Adobe Flash.


Have you looked into extensions that do what you want done? See this search of AddonsMozilla-Org for proxy extensions.

more options

I assume that you mean an extension and not a plugin since you mention the SDK.

Settings that show on the main page in Options/Preferences do not have an OK button to confirm a setting, but if there is an additional window opened then you will have to close this window to apply changes. The Network Settings window is one of such a window and you will have to click the OK button to close the window and apply the changes. If making changes to the prefs directly isn't working then it looks that there isn't a listener that monitors pref changes and changes are only detected if you open and close the Settings window.