Access to proxy parameters

Andrew McKay amckay at mozilla.com
Fri Jun 9 16:33:32 UTC 2017


On 9 June 2017 at 08:44, Capt'n Flash <contact at captnflash.fr> wrote:
> Hello,
>
>
>
> We are trying to migrate our Firefox extension to the new webextension
> standard, and we have some difficulties.
>
>
>
> 1.       We need to open the proxies preferences. Not changing it, but only
> open. Actually, we do :
>
> openDialog("chrome://browser/content/preferences/connection.xul");
>
>
>
> How can we do the same with webextension ?

That's not possible.


> 2.       We need to get the real html source of the current tab, and to pas
> sot to an external binary. Actuelly, we do :
>
>
>
> var _prefService =
> Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
>
>
>
>         _prefService.setBoolPref("view_source.editor.external", true);
>
>         _prefService.setCharPref("view_source.editor.path", "app.exe");
>
> _prefService.setCharPref("view_source.editor.args", "add_source_file");
>
>
>
> // send ctrl-u
>
> var utils =
> window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
> utils.sendKeyEvent("keypress", 117, 117, 2);
>
>
>
> //clear specific params
>
>        _prefService.setBoolPref("view_source.editor.external", false);
>
>        _prefService.setCharPref("view_source.editor.path", "");
>
> _prefService.setCharPref("view_source.editor.args", "");
>
>
>
> How can we do the same with webextension ?

I don't think that's possible, unless someone choose to work on this
bug https://bugzilla.mozilla.org/show_bug.cgi?id=1261289.

You could do a fetch to the same URL as the webRequest though:

https://developer.mozilla.org/en/docs/Web/API/Fetch_API

But I also suspect you were the person asking these questions on
#webextensions as well.

Thanks


More information about the Webextensions-support mailing list