hupf / tabmarks

Web Extension for handling groups of tabs persisted as bookmarks
https://addons.mozilla.org/en-US/firefox/addon/tabmarks/
MIT License
15 stars 1 forks source link

Maintain tab state on group switch. #9

Open krtkush opened 7 years ago

krtkush commented 7 years ago

Currently, all the tabs of a group reload/ load when the group is opened.

Is it possible to prevent that from happening?

hupf commented 7 years ago

As far as I understand, the WebExtension API does currently not provide any way to control this. The tabs.create() API also loads the page:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create

I also encountered long loading times when switching groups. The advantage is, that tabs of not-selected groups don't eat up any memory or cpu power...

But nonetheless there are discussions about a tab hiding API, I don't know what the state of it is: https://www.ghacks.net/2017/08/02/mozilla-makes-tab-hiding-api-a-priority/

edouard-lopez commented 7 years ago

Thanks for your work @hupf.

State preservation would be huge improvement, hope @firefox move on this.

Direct link to the bug issue

hupf commented 7 years ago

In this article a planned tabs.discard API is mentioned.

There is also this open feature request: Support the "discarded" property inside browser.tabs.create().

freaktechnik commented 7 years ago

I guess you could try finding the tab using the sessions API for now, though it is almost impossible to identify the correct target to restore, since you can't go by tab id, only by url and title.

Also, discarding only unloads a tab, it doesn't hide it, hiding is a separate thing, see https://mail.mozilla.org/pipermail/dev-addons/2017-October/003320.html for the latest news on the API that is best suited for tab group add-ons.