Skip to content

How to add a custom menuitem

ithinc edited this page Mar 19, 2014 · 5 revisions

Save the following settings to a text file, and import it via "TU Options > Settings > Import...".

"Open Link in Background Tab" & "Open Link in Foreground Tab":

pref("extensions.tabutils.menu.context-openlinkintab", false);

pref("extensions.tabutils.menu.context-openlinkinbackground", true);
pref("extensions.tabutils.menu.context-openlinkinbackground.label", "Open Link in Background Tab");
pref("extensions.tabutils.menu.context-openlinkinbackground.accesskey", "B");
pref("extensions.tabutils.menu.context-openlinkinbackground.insertafter", "context-openlinkintab");
pref("extensions.tabutils.menu.context-openlinkinbackground.oncommand", "var pref = 'browser.tabs.loadInBackground', loadInBackground = TU_getPref(pref);TU_setPref(pref, true);gContextMenu.openLinkInTab();TU_setPref(pref, loadInBackground);");
pref("extensions.tabutils.css.openlinkinbackground", "#context-openlinkintab[hidden='true'] ~ #context-openlinkinbackground {display: none;}");

pref("extensions.tabutils.menu.context-openlinkinforeground", true);
pref("extensions.tabutils.menu.context-openlinkinforeground.label", "Open Link in Foreground Tab");
pref("extensions.tabutils.menu.context-openlinkinforeground.accesskey", "F");
pref("extensions.tabutils.menu.context-openlinkinforeground.insertafter", "context-openlinkintab");
pref("extensions.tabutils.menu.context-openlinkinforeground.oncommand", "var pref = 'browser.tabs.loadInBackground', loadInBackground = TU_getPref(pref);TU_setPref(pref, false);gContextMenu.openLinkInTab();TU_setPref(pref, loadInBackground);");
pref("extensions.tabutils.css.openlinkinforeground", "#context-openlinkintab[hidden='true'] ~ #context-openlinkinforeground {display: none;}");

"Copy Tab Title":

pref("extensions.tabutils.menu.context_copyTabTitle", true);
pref("extensions.tabutils.menu.context_copyTabTitle.label", "Copy Tab Title");
pref("extensions.tabutils.menu.context_copyTabTitle.accesskey", "T");
pref("extensions.tabutils.menu.context_copyTabTitle.insertbefore", "context_copyTabURL");
pref("extensions.tabutils.menu.context_copyTabTitle.multiselected", "any");
pref("extensions.tabutils.menu.context_copyTabTitle.oncommand", "Services.nsIClipboardHelper.copyString([tab.label for (tab of gBrowser.mContextTabs)].join('\\n'));");

"Freeze Tab":

pref("extensions.tabutils.menu.context_freezeTab", true);
pref("extensions.tabutils.menu.context_freezeTab.label", "Freeze Tab");
pref("extensions.tabutils.menu.context_freezeTab.accesskey", "F");
pref("extensions.tabutils.menu.context_freezeTab.insertafter", "context_lockTab");
pref("extensions.tabutils.menu.context_freezeTab.multiselected", "any");
pref("extensions.tabutils.menu.context_freezeTab.oncommand", "gBrowser.freezeTab(gBrowser.mContextTabs);");

"Unload Tab":

pref("extensions.tabutils.menu.context_restartTab.label", "Unload Tab");
pref("extensions.tabutils.menu.context_restartTab.accesskey", "U");
pref("extensions.tabutils.menu.context_restartTab.oncommand", "gBrowser._blurTab(gBrowser.mContextTab);gBrowser.restartTab(gBrowser.mContextTab);");