Skip to content

Instantly share code, notes, and snippets.

@wisq
Created November 17, 2015 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wisq/521731c3395810cb23db to your computer and use it in GitHub Desktop.
Save wisq/521731c3395810cb23db to your computer and use it in GitHub Desktop.
Multifox .vimperatorrc snippet
command! home js set_multifox_profile("3");
command! work js set_multifox_profile("2");
" Get the multifox version hash by looking inside the multifox XPI file.
" (Look at the hash it uses in its own imports.)
:js << EOF
Components.utils.import("resource://multifox-88f97b0/commands.js");
function set_multifox_profile(id) {
event = {
target: {
ownerDocument: {defaultView: {top: window}},
hasAttribute: function(name) { return name == "profile-id" },
getAttribute: function(name) { return id },
}
};
windowCommand(event, "cmd_select_profile");
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment