IMacros with proxy script

2019-07-20 02:08发布

Is there any way where we can change proxy in iMacros Firefox extension together with checking if the proxy is running or not??

Below is the code to change proxy, but cant figure out a way to check whether the proxy is running or not?

SET !ERRORIGNORE YES

SET !DATASOURCE proxies.csv

SET !DATASOURCE_COLUMNS 2

SET !LOOP 1

SET !DATASOURCE_LINE {{!LOOP}}

SET !TIMEOUT 60

CLEAR

'proxy module

URL GOTO=about:config

URL GOTO=javascript:varprefb=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);varstr=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);str.data="{{!COL1}}";prefb.setComplexValue("network.proxy.http",Components.interfaces.nsISupportsString,str);

URL GOTO=about:config

URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.http_port",{{!COL2}});

2条回答
一夜七次
2楼-- · 2019-07-20 02:26

http://wiki.imacros.net/PROXY

SET !ERRORIGNORE YES

SET !DATASOURCE proxies.csv

SET !DATASOURCE_COLUMNS 2

SET !DATASOURCE_LINE {{!LOOP}}

SET !TIMEOUT 60

CLEAR

PROXY ADDRESS={{!COL2}}) 

You can try it your way or this way.

查看更多
别忘想泡老子
3楼-- · 2019-07-20 02:31

You can use JavaScript code for changing proxy address and port.

var ProxyIP = '121.43.146.196';
var ProxyPort = '1080';
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setIntPref("network.proxy.type", 1);
Services.prefs.setCharPref("network.proxy.http", ProxyIP);
Services.prefs.setIntPref("network.proxy.http_port", ProxyPort);
查看更多
登录 后发表回答