General
: K-Meleon Web Browser Forum
General discussion about K-Meleon
Go to:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
[Please, enable JavaScript to see the code]
Enter code:
[quote=kko] [quote=neolem]Perhaps the guy who had the idea of that macro can still improve it a bit. ... It's still the very best proxy feature any browser ever had so far.[/quote] If I'm right, these macros were originally designed by Hao, the developer of K-Meleon CCF. We found it useful and decided to integrate it in km 1.0. I try to improve it step by step, but it's still pretty limited. I plan to add a GUI to Advanced Preferences to allow all possible settings (similar to Preferences > Proxy). However, I've had no time yet... [hr] Nice to hear that you could make it, neolem. Since it may be interesting for others too, I try to explain how it's done (for km 1.0x, not 1.1): [u]Add the boldened lines to your macros.cfg[/u]: [code] # ----- Custom Proxies $proxy="network.proxy."; $cprxy=$macroPrefBranch."proxy"; ProxySync{ setcheck("macros(proxy1)",(getpref(STRING,$cprxy."1.http")==getpref(STRING,$proxy."http"))*(getpref(INT,$proxy."type")==1)?true:false); setcheck("macros(proxy2)",(getpref(STRING,$cprxy."2.http")==getpref(STRING,$proxy."http"))*(getpref(INT,$proxy."type")==1)?true:false); setcheck("macros(proxy3)",(getpref(STRING,$cprxy."3.http")==getpref(STRING,$proxy."http"))*(getpref(INT,$proxy."type")==1)?true:false); [b]setcheck("macros(proxy4)",(getpref(STRING,$cprxy."4.http")==getpref(STRING,$proxy."http"))*(getpref(INT,$proxy."type")==1)?true:false); setcheck("macros(proxy5)",(getpref(STRING,$cprxy."5.http")==getpref(STRING,$proxy."http"))*(getpref(INT,$proxy."type")==1)?true:false);[/b] setcheck("macros(NoProxy)",getpref(INT,$proxy."type")?false:true); } proxy1{ $n="1"; menu=getpref(STRING,$cprxy."1.name"); &CPuse; } proxy2{ $n="2"; menu=getpref(STRING,$cprxy."2.name"); &CPuse; } proxy3{ $n="3"; menu=getpref(STRING,$cprxy."3.name"); &CPuse; } [b]proxy4{ $n="4"; menu=getpref(STRING,$cprxy."4.name"); &CPuse; } proxy5{ $n="5"; menu=getpref(STRING,$cprxy."5.name"); &CPuse; }[/b] CPuse{ $srvr=getpref(STRING,$cprxy.$n.".http"); $port=getpref(INT,$cprxy.$n.".http_port"); # When no server url is set, do not change anything! $srvr==""?0: setpref(STRING,$proxy."http",$srvr); $srvr==""?0: setpref(INT,$proxy."http_port",$port); $srvr==""?0: setpref(INT,$proxy."type",1); getpref(INT,$proxy."type")==1?statusbar(sub("%url",getpref(STRING,$proxy."http"),sub("%port",getpref(INT,$proxy."http_port"),_("Connecting over proxy %url:%port")))):&NoProxy; &ProxySync; } CPset{ $name=prompt(_("Server name:"),$tit,$name); $name==""?0: setpref(STRING,$cprxy.$n.".name",$name); $name==""?$srvr="":$srvr=prompt(_("Server URL:"),$tit,$srvr); $srvr==""?0: setpref(STRING,$cprxy.$n.".http",$srvr); $srvr==""?$port="":$port=prompt(_("Server port:"),$tit,$port); $port==""?0: setpref(INT,$cprxy.$n.".http_port",$port); } NoProxy { setpref(INT,$proxy."type",0); statusbar(_("Connecting directly")); &ProxySync; } ProxyCfg{ $n=1; while($n!=[b]6[/b]) &ProxyCfgLoop; } ProxyCfgLoop{ $name=getpref(STRING,$cprxy.$n.".name"); $srvr=getpref(STRING,$cprxy.$n.".http"); $port=getpref(INT,$cprxy.$n.".http_port"); $tit=sub("%s",$name==""?$n:$name,_("HTTP Proxy Configuration")); $msg=sub("%n",$n,_("Current settings for proxy %n:"))."\n\n".sub("%s",$name,_("Server name:\t%s"))."\n".sub("%s",$srvr==""?_("(not set)"):$srvr,_("Server URL:\t%s"))."\n".sub("%s",$port==0?_("(not set)"):$port,_("Server port:\t%s"))."\n\n"._("Do you want to change these settings?"); $r=confirm($msg,$tit,YESNOCANCEL,QUESTION); $r==YES?&CPset: ($r==NO?$n=$n+1:$n=[b]6[/b]); } [/code] Don't forget the [b]6[/b] ! [u]Add the boldened lines to your menus.cfg[/u]: [code] # ----- Custom Proxies Pro&xy{ macros(NoProxy,&Direct Connection) macros(proxy1) macros(proxy2) macros(proxy3) [b]macros(proxy4) macros(proxy5)[/b] - macros(ProxyCfg,Con&figure...) } [/code] [u]Finally, add these lines to your prefs.js[/u]: [code] user_pref("kmeleon.plugins.macros.proxy1.name", "Custom Proxy 4"); user_pref("kmeleon.plugins.macros.proxy2.name", "Custom Proxy 5"); [/code] The files macros.cfg, menus.cfg and prefs.js are all located in your profile directory. You can open this directory from out of km (Edit > Configuration > Profile Directory). Make sure km is closed while editing these files![/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
FAQ
English