I’m working on updating my Firefox extension, Panic Button, to handle tab groups. Currently, if a user invoked the Panic Button action to close all browser windows, when Panic Button restores them afterwards, any tab groups in the browser window are lost, although the tabs themselves are intact.
But I notice that the previous tab groups are still accessible from the List All Tabs menu (on the right-hand side of the browser tab bar). The recent tab groups are listed there, and the user could click on them to bring them back.
Is there a way to bring back recently-closed tab groups using the WebExtensions API? I’m reading the documentation on MDN and experimenting in the extension console, and so far I’ve discovered that browser.tabGroups.get()
won’t recognize the ID of a recently-closed tab group and will throw an exception.
I suppose that one solution would be for my extension to recreate the tab groups when restoring the browser windows, using the available APIs. But that would create duplicate entries in the list of recently-closed tab groups – one for the tab group that was closed, and the other for the one created by my extension via API.