MozillaZine

Keyconfig extension: Firefox

From MozillaZine Knowledge Base

Revision as of 20:32, 26 January 2005; view current revision
←Older revision | Newer revision→
These are example lines you can add to Firefox's prefs.js or user.js files to customize keyboard shortcuts. You need to install keyconfig extension first. A similar page for Thunderbird is available.

Contents

Firefox General

user_pref("keyconfig.main.xxx_key__Extensions", "!][][][BrowserOpenExtensions('extensions');");
user_pref("keyconfig.main.xxx_key__Manage Bookmarks", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');");
user_pref("keyconfig.main.xxx_key__Next Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);");
user_pref("keyconfig.main.xxx_key__Previous Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);");
user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");
user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");

Keybinding for Bookmark Keyword (replace "KEYWORD" with you keyword):

user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('KEYWORD',{}));");

Scrolling:

user_pref("keyconfig.main.xxx_key__Page Down", "!][][][goDoCommand('cmd_scrollPageDown');");
user_pref("keyconfig.main.xxx_key__Page Up", "!][][][goDoCommand('cmd_scrollPageUp');");
user_pref("keyconfig.main.xxx_key__Scroll Bottom", "!][][][goDoCommand('cmd_scrollBottom');");
user_pref("keyconfig.main.xxx_key__Scroll Top", "!][][][goDoCommand('cmd_scrollTop);");

Extensions

miniT or Tab Mix

user_pref("keyconfig.main.xxx_key__Move Tab -> End", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mTabContainer.childNodes.length-1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Left", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Right", "!][][][if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal+1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Start", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);");


Menu Editor

user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');");


Enhanced Bookmark Search

Open "Bookmarks > Search Bookmarks":

user_pref("keyconfig.main.xxx_key__Search Bookmarks", "!][][][window.openDialog('chrome://bcpm/content/findBookmark.xul', 'FindBookmarksWindow', 'dialog=no,centerscreen,resizable=no,chrome,dependent');");


SessionSaver

user_pref("keyconfig.main.xxx_key__SessionSaver - Capture Default", "!][][][SessionSaver.hiddenObserver.observe(null, 'SessionSaver-CaptureAll', null);");
user_pref("keyconfig.main.xxx_key__SessionSaver - Restore Default", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)");

Capture New Session:

user_pref("keyconfig.main.xxx_key__SessionSaver - Capture New", "!][][][SessionSaver.sessionPrompt();");