firefoxtabsfirefox-addontitleadd-on

How can I copy a list of the open tab titles in Firefox?


I've been trying to copy a list of the open tab titles in Firefox, but I cannot seem to find a solution.

The closest I've came is by using: https://addons.mozilla.org/en-us/firefox/addon/send-tab-urls/

But this add-on copies other details in addition to the tab titles.

I cannot find a solution anywhere for this simple task.

Does anybody have any tips on how to accomplish this?


Solution

  • You can use the Multiple Tab Handler addon. Right click, then Copy URI of All Tabs. You will need to tweak the addon's options to output the result in the format you want.

    Or alternatively, open up Firefox's Scratchpad developer tool (Shift-F4) and use the following code in browser environment.

    // -sp-context: browser
    var tabs=Array.from(gBrowser.visibleTabs);
    var urls=tabs.map(t=>gBrowser.getBrowserForTab(t).currentURI.spec);
    var titles=tabs.map(t=>gBrowser.getBrowserForTab(t).contentTitle);
    urls.join("\n");
    titles.join("\n");
    

    The variable titles will contain the array of titles of the currently visible tabs (i.e. tabs in the current tab group). Use Display to view the contents of the variable.