Keyconfig extension: Firefox
From MozillaZine Knowledge Base
Firefox Functions
Open Location
Menu: File -> Open Location
user_pref("keyconfig.main.xxx_key__Open Location", "!][][][gBrowser.loadURI('http://www.mozilla.org/');");
Extensions
Menu: Tools -> Extensions
user_pref("keyconfig.main.xxx_key__Extensions", "!][][][BrowserOpenExtensions('extensions');");
Themes
Menu: Tools -> Themes
user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");
Bookmarks Manager
Menu: Bookmarks -> Manage Bookmarks
user_pref("keyconfig.main.xxx_key__Manage Bookmarks", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');");
Next Tab
user_pref("keyconfig.main.xxx_key__Next Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);");
Previous Tab
user_pref("keyconfig.main.xxx_key__Previous Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);");
Reload All Tabs
user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");
Close Tab and Focus to the left Tab
user_pref("keyconfig.main.xxx_key__Close Tab & Focus to the left", "!][][][var tab = gBrowser.mCurrentTab; if(tab.previousSibling) gBrowser.mTabContainer.selectedIndex--; gBrowser.removeTab(tab);");
Close Tab and Focus to the right Tab
user_pref("keyconfig.main.xxx_key__Close Tab & Focus to the right", "!][][][var tab = gBrowser.mCurrentTab; if(tab.nextSibling) gBrowser.mTabContainer.selectedIndex++; gBrowser.removeTab(tab);");
Close current Tab
var tab = gBrowser.mCurrentTab;
gBrowser.removeTab(tab);
Bookmark Keyword
Opens the bookmark with the specified keyword. Replace the string KEYWORD with your bookmark's keyword.
user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('KEYWORD',{}));");
Back Menu
Similar to the menu that appears when right-clicking the Back Button. If the menu is too low, decrease the 25 in the following line; if it is too high, increase it.
user_pref("keyconfig.main.xxx_key__Back Menu", '!][][][var elm = document.getElementById("back-button"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("backMenu").showPopup(elm, x, y, "popup", null, null);');
Forward Menu
Similar to the menu that appears when right-clicking the Forward Button. If the menu is too low, decrease the 25 in the following line; if it is too high, increase it.
user_pref("keyconfig.main.xxx_key__Forward Menu", '!][][][var elm = document.getElementById("forward-button"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("forwardMenu").showPopup(elm, x, y, "popup", null, null);');
Focus Content
Activate the selected content, as if you clicked on it. You need this, for example, if you want to scroll with the cursor keys and nothing happens.
user_pref("keyconfig.main.xxx_key__Focus Content", "!][][][_content.focus();");
Scroll Page Down
user_pref("keyconfig.main.xxx_key__Page Down", "!][][][goDoCommand('cmd_scrollPageDown');");
Scroll Page Up
user_pref("keyconfig.main.xxx_key__Page Up", "!][][][goDoCommand('cmd_scrollPageUp');");
Scroll to the Bottom
user_pref("keyconfig.main.xxx_key__Scroll Bottom", "!][][][goDoCommand('cmd_scrollBottom');");
Scroll to the Top
user_pref("keyconfig.main.xxx_key__Scroll Top", "!][][][goDoCommand('cmd_scrollTop);");
Scroll Line Down
user_pref("keyconfig.main.xxx_key__Scroll Line Down", "!][][][goDoCommand('cmd_scrollLineDown);");
Scroll Line Up
user_pref("keyconfig.main.xxx_key__Scroll Line Up", "!][][][goDoCommand('cmd_scrollLineUp);");
Zap Images
Based on Jesse Ruderman's bookmarklet Zap Images
user_pref("keyconfig.main.xxx_key__Zap Image", "!][][][(function(){function toArray (c){ var a, k; a=new Array; for (k=0; k < c.length; ++k) a[k]=c[k]; return a; } var images, img, altText; images=toArray(content.document.images); for (var i=0; i < images.length; ++i){ img=images[i]; altText=content.document.createTextNode(img.alt); img.parentNode.replaceChild(altText, img) }})();][chrome://browser/content/browser.xul");