Keyconfig extension: Firefox: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
No edit summary
(→‎Firefox General: Added 2 lines "Close tab...")
Line 9: Line 9:
user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");
user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");
user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");
user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");
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);");
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);");
</pre>
</pre>
Keybinding for Bookmark Keyword (replace "KEYWORD" with your keyword):
Keybinding for Bookmark Keyword (replace "KEYWORD" with your keyword):

Revision as of 10:46, 1 February 2005

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.

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');");
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);");
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);"); 

Keybinding for Bookmark Keyword (replace "KEYWORD" with your 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

Googlebar

user_pref("keyconfig.main.xxx_key__Googlebar - Clear search history", "!][][][googlebarClearHistory( true )");
user_pref("keyconfig.main.xxx_key__Googlebar - Up a directory", "!][][][googlebarUp(event)");

Highlight search terms (toggle):

user_pref("keyconfig.main.xxx_key__Googlebar - Highlight search terms", "!][][][googlebarHighLightInPage()");


Menu Editor

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


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);");


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 Session", "!][][][SessionSaver.hiddenObserver.observe(null, 'SessionSaver-CaptureAll', null);");
user_pref("keyconfig.main.xxx_key__SessionSaver - Restore Default Session", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)");
user_pref("keyconfig.main.xxx_key__SessionSaver - Capture New Session", "!][][][SessionSaver.sessionPrompt();");