Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

I can't use imacros to change proxy value in about:config from firefox 34

  • 6 답장
  • 1 이 문제를 만남
  • 31 보기
  • 최종 답변자: stevejob

more options

myproxy.iim

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="IP HERE";prefb.setComplexValue("network.proxy.http",Components.interfaces.nsISupportsString,str);

URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.http_port",PORT HERE);

URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.type",1);

I try above script many times for imacros but it doesn't work in about:config of firefox 34. Please tell me the way to resolve my problem. Thanks a lot URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.type",1);

myproxy.iim 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="IP HERE";prefb.setComplexValue("network.proxy.http",Components.interfaces.nsISupportsString,str); URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.http_port",PORT HERE); URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.type",1); I try above script many times for imacros but it doesn't work in about:config of firefox 34. Please tell me the way to resolve my problem. Thanks a lot URL GOTO=about:config URL GOTO=javascript:gPrefBranch.setIntPref("network.proxy.type",1);

글쓴이 cor-el 수정일시

모든 댓글 (6)

more options

I notice a missing space in varprefb -> var prefb and varstr -> var str

varprefb=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);

Note that such issues can happen if you paste text that have line breaks in a single line text field

var
prefb=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);

You can check the editor.singleLine.pasteNewlines pref on the about:config page.

글쓴이 cor-el 수정일시

more options

Thank you for your answer, but I haven't still resolved my problem

I access "about:config" in firefox. How can I modify "network.proxy.type 0" => "network.proxy.type 1" "network.proxy.socks 0" => "network.proxy.socks 64.31.22.131" "network.proxy.socks_port 0" => "network.proxy.socks 3127"

by using javascript code

Thank you a lot

more options

You can use the pref service to modify prefs. You do not need the about:config page.

more options

cor-el said

You can use the pref service to modify prefs. You do not need the about:config page.

I use below javascript code, but I could not change "network.proxy.http" in about:config firefox 34.

proxy.php <head> <script type="text/javascript">

function myfunction(){

var prefs=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);

var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

str.data="183.20.0.1"; prefs.setComplexValue("network.proxy.http",Components.interfaces.nsISupportsString,str);

</script> </head> <body> <button onclick="myfunction();">Click here</button> </body> </html>

Could you please give me an detailed example? Thank you a lot

more options

I'm not familiar with the iMacro extension, so it is possible that the above posted code stops working for other reasons and that the var prefix is there on purpose (based on convention), so I may have been wrong there.

I'm not sure what you intend to do with that network.proxy.http pref as it doesn't seem to exist for me on the about:config page and 183.20.0.1 is a normal String value that shouldn't require a complex value (setCharPref() would do).

See also:

You can check the Browser Console (Firefox/Tools > Web Developer) for error messages.

You would have to contact the iMacro author for support if the extension isn't working properly.

more options

Thank you a lot for your answers. Have a good day