Keyconfig extension: Firefox: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(Added Show Anchors)
(Fixed overlapping text in text boxes; Added descriptions; Added: Googlebar - Up a directory Popup, Undoclosetab enh.)
Line 1: Line 1:
:''These are example lines you can add to Firefox's [[prefs.js]] file to customize keyboard shortcuts. You need to install [[keyconfig extension]] first. A [[Keyconfig extension - Custom Keys for Thunderbird|similar page for Thunderbird]] is available.''
==Firefox General==
==Firefox General==
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Extensions</font>", "!][][][BrowserOpenExtensions('extensions');");
{|
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Manage Bookmarks</font>", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');");
|'''Extensions'''
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Next Tab</font>", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);");
|-
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Previous Tab</font>", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);");
  |''Menu:'' Tools > Extensions
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Reload All Tabs</font>", "!][][][gBrowser.reloadAllTabs();");
|-
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Themes</font>", "!][][][BrowserOpenExtensions('themes');");
|<pre>user_pref("keyconfig.main.xxx_key__Extensions", "!][][][BrowserOpenExtensions('extensions');");</pre>
  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.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);");  
|'''Themes'''
|-
|''Menu:'' Tools > Themes
|-
  |<pre>user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");</pre>
|-
|'''Bookmarks Manager'''
|-
|''Menu:'' Bookmarks > Manage Bookmarks
|-
|<pre>user_pref("keyconfig.main.xxx_key__Manage Bookmarks", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');");</pre>
|-
|'''Next Tab'''
  |-
|<pre>user_pref("keyconfig.main.xxx_key__Next Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);");</pre>
|-
|'''Previous Tab'''
|-
  |<pre>user_pref("keyconfig.main.xxx_key__Previous Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);");</pre>
|-
  |'''Reload All Tabs'''
|-
|<pre>user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");</pre>
|-
|'''Close Tab and Focus to the left Tab'''
|-
  |<pre>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);");</pre>
|-
  |'''Close Tab and Focus to the right Tab'''
|-
|<pre>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>
|-
|'''Bookmark Keyword'''
|-
|Opens the bookmark with the specified keyword. Replace the string KEYWORD with your bookmark's keyword.
|-
|<pre>user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('KEYWORD',{}));");</pre>
|-
|'''Back Menu'''
|-
|Like 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.
  |-
|<pre>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);');</pre>
|-
|'''Forward Menu'''
|-
|Like 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.
|-
|<pre>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);');</pre>
|-
|'''Focus Content'''
|-
|Activate the content, where the page is showed, as if you would click on it. You need this for example if you want to scroll with the cursor keys and nothing happens.
|-
|<pre>user_pref("keyconfig.main.xxx_key__Focus Content", "!][][][_content.focus();");</pre>
|-
|'''Scroll Page Down'''
|-
|<pre>user_pref("keyconfig.main.xxx_key__Page Down", "!][][][goDoCommand('cmd_scrollPageDown');");</pre>
|-
|'''Scroll Page Up'''
|-
|<pre>user_pref("keyconfig.main.xxx_key__Page Up", "!][][][goDoCommand('cmd_scrollPageUp');");</pre>
|-
|'''Scroll to the Bottom'''
|-
|<pre>user_pref("keyconfig.main.xxx_key__Scroll Bottom", "!][][][goDoCommand('cmd_scrollBottom');");</pre>
|-
|'''Scroll to the Top'''
|-
|<pre>user_pref("keyconfig.main.xxx_key__Scroll Top", "!][][][goDoCommand('cmd_scrollTop);");</pre>
|}


Keybinding for Bookmark Keyword (replace <font style="color:#FF0000">KEYWORD</font> with your 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 low, decrease the <font style="color:#FF0000">25</font>, if it is too high, increase it):
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);');
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);');
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();");
Scrolling:
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Page Down</font>", "!][][][goDoCommand('cmd_scrollPageDown');");
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Page Up</font>", "!][][][goDoCommand('cmd_scrollPageUp');");
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Scroll Bottom</font>", "!][][][goDoCommand('cmd_scrollBottom');");
user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Scroll Top</font>", "!][][][goDoCommand('cmd_scrollTop);");


==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.xxx_key__<font style="color:#0000FF">Googlebar - Up a directory</font>", "!][][][googlebarUp(event)");
|'''Clear search history'''
 
|-
Highlight search terms (toggle):
  |Googlebar Button > Clear search history
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Googlebar - Highlight search terms</font>", "!][][][googlebarHighLightInPage()");
|-
|<pre>user_pref("keyconfig.main.xxx_key__Googlebar - Clear search history", "!][][][googlebarClearHistory( true )");</pre>
  |-
|'''Up a directory'''
|-
|Like pressing the button "Up a directory"
|-
|<pre>user_pref("keyconfig.main.xxx_key__Googlebar - Up a directory", "!][][][googlebarUp(event)");</pre>
|-
|'''Up a directory (Popup Menu)'''
|-
|Opens the popup menu of the button "Up a directory"
|-
|<pre>user_pref("keyconfig.main.xxx_key__Googlebar - Up a directory (Popup Menu)", '!][][][var elm = document.getElementById("up-dir-popup"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("up-dir-popup").showPopup(elm, x, y, "popup", null, null);');</pre>
|-
|'''Highlight search terms (Toggle):'''
  |-
|<pre>user_pref("keyconfig.main.xxx_key__Googlebar - Highlight search terms (Toggle)", "!][][][googlebarHighLightInPage()");</pre>
|}




===Menu Editor===
===Menu Editor===
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Menu Editor</font>", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');");
{|
  |'''Open Preferences for Menu Editor'''
|-
|''Menu:'' Tools > Extensions > Menu Editor > Options
|-
|<pre>user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul',, 'resizable');");</pre>
|}




===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.xxx_key__<font style="color:#0000FF">Move Tab -> Left</font>", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);");
|'''Move Tab to the end of the tab bar'''
  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.xxx_key__<font style="color:#0000FF">Move Tab -> Start</font>", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);");
  |<pre>user_pref("keyconfig.main.xxx_key__Move Tab -> End", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mTabContainer.childNodes.length-1);");</pre>
|-
|'''Move Tab to the left'''
|-
  |<pre>user_pref("keyconfig.main.xxx_key__Move Tab -> Left", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);");</pre>
|-
|'''Move Tab to the right'''
|-
  |<pre>user_pref("keyconfig.main.xxx_key__Move Tab -> Right", "!][][][if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal+1);");</pre>
|-
|'''Move Tab to the start of the tab bar'''
|-
  |<pre>user_pref("keyconfig.main.xxx_key__Move Tab -> Start", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);");</pre>
|}




===Enhanced Bookmark Search===
===Enhanced Bookmark Search===
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');");
|'''Search Bookmarks'''
|-
|''Menu:'' Bookmarks > Search Bookmarks
  |-
|<pre>user_pref("keyconfig.main.xxx_key__Search Bookmarks", "!][][][window.openDialog('chrome://bcpm/content/findBookmark.xul', 'FindBookmarksWindow', 'dialog=no,centerscreen,resizable=no,chrome,dependent');");</pre>
|}




===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.xxx_key__<font style="color:#0000FF">SessionSaver - Restore Default Session</font>", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)");
  |'''Capture Default Session'''
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">SessionSaver - Capture New Session</font>", "!][][][SessionSaver.sessionPrompt();");
|-
|''Menu:'' File > Capture
|-
|<pre>user_pref("keyconfig.main.xxx_key__SessionSaver - Capture Default Session", "!][][][SessionSaver.hiddenObserver.observe(null, 'SessionSaver-CaptureAll', null);");</pre>
|-
|'''Restore Default Session'''
|-
|''Menu:'' File > Restore Session
  |-
|<pre>user_pref("keyconfig.main.xxx_key__SessionSaver - Restore Default Session", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)");</pre>
|-
|'''Capture New Session'''
  |-
|''Menu:'' Tools > SessionSaver > New
|-
|<pre>user_pref("keyconfig.main.xxx_key__SessionSaver - Capture New Session", "!][][][SessionSaver.sessionPrompt();");</pre>
|}




===Show Anchors===
===Show Anchors===
  user_pref("keyconfig.main.xxx_key__<font style="color:#0000FF">Show Anchors Toggle</font>"", "!][][][Objshowanchors.change();");
{|
  |'''Show Anchors (Toggle)'''
|-
|Like right-clicking and selecting "Show Anchors"
|-
|<pre>user_pref("keyconfig.main.xxx_key__Show Anchors Toggle"", "!][][][Objshowanchors.change();");</pre>
|}
 
 
===Undoclosetab enhanced===
{|
|'''Retrieve closed tabs (Popup Menu)'''
|-
|Like clicking on the button "Retrieve tabs that you've closed"
|-
|<pre>user_pref("keyconfig.main.xxx_key__Undoclosetab enh. - Retrieve closed tabs (Popup Menu)", '!][][][var elm = document.getElementById("undoclose-popup"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("undoclose-popup").showPopup(elm, x, y, "popup", null, null);');</pre>
|}

Revision as of 00:06, 7 February 2005

Firefox General

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);"); 
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
Like 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
Like 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 content, where the page is showed, as if you would click 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);");


Extensions

Googlebar

Clear search history
Googlebar Button > Clear search history
user_pref("keyconfig.main.xxx_key__Googlebar - Clear search history", "!][][][googlebarClearHistory( true )");
Up a directory
Like pressing the button "Up a directory"
user_pref("keyconfig.main.xxx_key__Googlebar - Up a directory", "!][][][googlebarUp(event)");
Up a directory (Popup Menu)
Opens the popup menu of the button "Up a directory"
user_pref("keyconfig.main.xxx_key__Googlebar - Up a directory (Popup Menu)", '!][][][var elm = document.getElementById("up-dir-popup"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("up-dir-popup").showPopup(elm, x, y, "popup", null, null);');
Highlight search terms (Toggle):
user_pref("keyconfig.main.xxx_key__Googlebar - Highlight search terms (Toggle)", "!][][][googlebarHighLightInPage()");


Menu Editor

Open Preferences for Menu Editor
Menu: Tools > Extensions > Menu Editor > Options
user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul',, 'resizable');");


miniT or Tab Mix

Move Tab to the end of the tab bar
user_pref("keyconfig.main.xxx_key__Move Tab -> End", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mTabContainer.childNodes.length-1);");
Move Tab to the left
user_pref("keyconfig.main.xxx_key__Move Tab -> Left", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);");
Move Tab to the right
user_pref("keyconfig.main.xxx_key__Move Tab -> Right", "!][][][if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal+1);");
Move Tab to the start of the tab bar
user_pref("keyconfig.main.xxx_key__Move Tab -> Start", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);");


Enhanced Bookmark Search

Search Bookmarks
Menu: 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

Capture Default Session
Menu: File > Capture
user_pref("keyconfig.main.xxx_key__SessionSaver - Capture Default Session", "!][][][SessionSaver.hiddenObserver.observe(null, 'SessionSaver-CaptureAll', null);");
Restore Default Session
Menu: File > Restore Session
user_pref("keyconfig.main.xxx_key__SessionSaver - Restore Default Session", "!][][][SessionSaver.sessionRecall(null, SessionSaver.prefBranchStatic + SessionSaver.staticBranchDefault)");
Capture New Session
Menu: Tools > SessionSaver > New
user_pref("keyconfig.main.xxx_key__SessionSaver - Capture New Session", "!][][][SessionSaver.sessionPrompt();");


Show Anchors

Show Anchors (Toggle)
Like right-clicking and selecting "Show Anchors"
user_pref("keyconfig.main.xxx_key__Show Anchors Toggle"", "!][][][Objshowanchors.change();");


Undoclosetab enhanced

Retrieve closed tabs (Popup Menu)
Like clicking on the button "Retrieve tabs that you've closed"
user_pref("keyconfig.main.xxx_key__Undoclosetab enh. - Retrieve closed tabs (Popup Menu)", '!][][][var elm = document.getElementById("undoclose-popup"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("undoclose-popup").showPopup(elm, x, y, "popup", null, null);');