Keyconfig extension: Firefox: Difference between revisions
From MozillaZine Knowledge Base
Jump to navigationJump to search
(coloured names and values, added description for back/menu menu) |
|||
Line 2: | Line 2: | ||
==Firefox General== | ==Firefox General== | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Extensions</font>", "!][][][BrowserOpenExtensions('extensions');"); | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Manage Bookmarks</font>", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Next Tab</font>", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Previous Tab</font>", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Reload All Tabs</font>", "!][][][gBrowser.reloadAllTabs();"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Themes</font>", "!][][][BrowserOpenExtensions('themes');"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Close Tab & Focus to the left</font>", "!][][][var tab = gBrowser.mCurrentTab; if(tab.previousSibling) gBrowser.mTabContainer.selectedIndex--; gBrowser.removeTab(tab);"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Close Tab & Focus to the right</font>", "!][][][var tab = gBrowser.mCurrentTab; if(tab.nextSibling) gBrowser.mTabContainer.selectedIndex++; gBrowser.removeTab(tab);"); | ||
user_pref("keyconfig.main. | |||
Keybinding for Bookmark Keyword (replace <font style="color:#FF0000">KEYWORD</font> with your keyword): | |||
Keybinding for Bookmark Keyword (replace "KEYWORD | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Keyword 1</font>", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('<font style="color:#FF0000">KEYWORD</font>',{}));"); | ||
Back Menu (like right-clicking the Back Button; if the menu is too deep, decrease the <font style="color:#FF0000">25</font>, if it is too high, increase it): | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Back Menu</font>", '!][][][var elm = document.getElementById("back-button"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + <font style="color:#FF0000">25</font>; document.getElementById("backMenu").showPopup(elm, x, y, "popup", null, null);'); | ||
Back Menu (like right-clicking the Back Button | |||
< | |||
user_pref("keyconfig.main. | |||
Forward Menu (like right-clicking the Forward Button): | Forward Menu (like right-clicking the Forward Button): | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Forward Menu</font>", '!][][][var elm = document.getElementById("forward-button"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + <font style="color:#FF0000">25</font>; document.getElementById("forwardMenu").showPopup(elm, x, y, "popup", null, null);'); | |||
user_pref("keyconfig.main. | |||
Focus Content (activate the content, where the page is showed, as if you would click on it; you need this for example when you want to scroll with the cursor keys and nothing happens): | Focus Content (activate the content, where the page is showed, as if you would click on it; you need this for example when you want to scroll with the cursor keys and nothing happens): | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Focus Content</font>", "!][][][_content.focus();"); | |||
user_pref("keyconfig.main. | |||
Scrolling: | Scrolling: | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Page Down</font>", "!][][][goDoCommand('cmd_scrollPageDown');"); | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Page Up</font>", "!][][][goDoCommand('cmd_scrollPageUp');"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Scroll Bottom</font>", "!][][][goDoCommand('cmd_scrollBottom');"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Scroll Top</font>", "!][][][goDoCommand('cmd_scrollTop);"); | ||
user_pref("keyconfig.main. | |||
==Extensions== | ==Extensions== | ||
===Googlebar=== | ===Googlebar=== | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Googlebar - Clear search history</font>", "!][][][googlebarClearHistory( true )"); | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Googlebar - Up a directory</font>", "!][][][googlebarUp(event)"); | ||
user_pref("keyconfig.main. | |||
Highlight search terms (toggle): | Highlight search terms (toggle): | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Googlebar - Highlight search terms</font>", "!][][][googlebarHighLightInPage()"); | |||
user_pref("keyconfig.main. | |||
===Menu Editor=== | ===Menu Editor=== | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Menu Editor</font>", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');"); | |||
user_pref("keyconfig.main. | |||
===miniT or Tab Mix=== | ===miniT or Tab Mix=== | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Move Tab -> End</font>", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mTabContainer.childNodes.length-1);"); | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Move Tab -> Left</font>", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Move Tab -> Right</font>", "!][][][if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal+1);"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Move Tab -> Start</font>", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);"); | ||
user_pref("keyconfig.main. | |||
===Enhanced Bookmark Search=== | ===Enhanced Bookmark Search=== | ||
Open "Bookmarks > Search Bookmarks": | Open "Bookmarks > Search Bookmarks": | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Search Bookmarks</font>", "!][][][window.openDialog('chrome://bcpm/content/findBookmark.xul', 'FindBookmarksWindow', 'dialog=no,centerscreen,resizable=no,chrome,dependent');"); | |||
user_pref("keyconfig.main. | |||
===SessionSaver=== | ===SessionSaver=== | ||
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">SessionSaver - Capture Default Session</font>", "!][][][SessionSaver.hiddenObserver.observe(null, 'SessionSaver-CaptureAll', null);"); | |||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">SessionSaver - Restore Default Session</font>", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)"); | ||
user_pref("keyconfig.main. | user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">SessionSaver - Capture New Session</font>", "!][][][SessionSaver.sessionPrompt();"); | ||
user_pref("keyconfig.main. | |||
Revision as of 18: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',{}));");
Back Menu (like right-clicking the Back Button; if the menu is too deep, decrease the 25, 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 (like right-clicking the Forward Button):
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 content, where the page is showed, as if you would click on it; you need this for example when you want to scroll with the cursor keys and nothing happens):
user_pref("keyconfig.main.xxx_key__Focus Content", "!][][][_content.focus();");
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();");