Skip to content

Code snippets for custom keyboard shortcuts

YUKI "Piro" Hiroshi edited this page Feb 14, 2016 · 21 revisions

Firefox already have very large number of keyboard shortcuts, and other addons also provide their own keyboard shortcuts, I cannot find out safe combinations for my features. So I gave up and decided to provide only APIs for other addons. Please use generic addons to customize keyboard shortcuts which can define custom actions based on scripts. Sorry.

See also:

Toggle show/hide the tab bar

if (gBrowser.treeStyleTab.tabbarShown) {
  gBrowser.treeStyleTab.hideTabbar();
} else {
  gBrowser.treeStyleTab.showTabbar();
}

Close the current and all descendant tabs

gBrowser.treeStyleTab.removeTabSubtree(gBrowser.selectedTab);