Javascript Change Firefox Proxy

I am trying to do what the title says and have been looking here for a while and I found a solution that looks viable. Only problem - the function is requre()

not recognized. Now I'm not sure if I need to update java, firefox or iMacros to fix this. Also, I'm not sure if I made a mistake in my code. For the following code, it is known that there is a proxy object that separates the proxy from the port.

var scope = {};
Components.utils.import("resource://imacros/utils.js", scope);
Components.utils.import("resource://imacros/rijndael.js", scope);
Components.utils.import("resource://gre/modules/ctypes.jsm", scope);

    var prefsvc = require("sdk/preferences/service");
    prefsvc.set("network.proxy.http", proxy[j].ip);
    prefsvc.set("network.proxy.http_port", proxy[j].port);
    prefsvc.set("network.proxy.type", 1);

      

What do you think the problem might be?

+3


source to share


1 answer


try it

var macro1;

macro1 ="CODE:";
macro1 +="PROXY ADDRESS={{proxy}}";

var macro2;

macro2 ="CODE:";
macro2 +="PROXY ADDRESS={{proxy}}";

var macro1;

macro1 ="CODE:";
macro1 +="PROXY ADDRESS={{proxy}}";

var macro3;

macro3="CODE:";
macro3+="PROXY ADDRESS={{proxy}}";

iimSet("proxy","1.1.1.1:8000")
iimPlay(macro1)

iimSet("proxy","1.1.1.1:8000")
iimPlay(macro2)

iimSet("proxy","1.1.1.1:8000")
iimPlay(macro3)

      



Edit:

var mainmacro;

mainmacro ="CODE:";
mainmacro +="PROXY ADDRESS={{proxy}}";

iimSet("proxy","1.1.1.1:8000")
iimPlay(mainmacro )

      

0


source







All Articles