Archive for December 16, 2010
Illegal names in vimperator
It appears that command names in vimperator with underscores are illegal. This confused me for a little while. (There error message is helpfullly indistinguishable from if you hadn’t defined the command)
Setting preferences in vimperator
I found out recently that vimperator has builtin commands to set preferences from its command line.
So, for example:
set! network.proxy.http = ‘myproxy.com’
followed by
set! network.proxy.type = 1
will switch on an existing http proxy.
Things are slightly different if you want to do things from javascript addons. Here you need to use the XPCOM interfaces. The following javascript code adds a noproxy command to clear your proxy settings.
js <<EOF commands.addUserCommand(['noproxy'], 'Switch off proxy', function (args) { pref.setIntPref('network.proxy.type', 0); }, {}, true ); EOF