Open Bug 1466904 Opened 6 years ago Updated 2 years ago

Add API to wake up a discarded tab

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: ianbicking, Unassigned)

References

(Blocks 1 open bug)

Details

Currently if you attempt to call browser.tabs.executeScript() on a discarded tab, the script isn't executed and the tab remains discarded. I've created a small extension to demonstrate the current behavior: https://github.com/ianb/test-discarded-tabs-extension There are two resolutions I can see: 1. Wake the tab up on demand. Per some discussion, this used to be the behavior, but it made it easy for an extension to restore all tabs on session restore, with poor performance characteristics. 2. Allow the tab to be woken up. Currently you can do this by activating the tab, but I think it would be nice to allow it to be done without changing the user's active tab (which is intrusive). 2b. Give an error if you attempt to interact with a discarded tab. Currently the call never returns.
Depends on: 1322485
Product: Toolkit → WebExtensions
tabs.reload() isn't ideal. Restoring a discarded tab is meant to be extremely conservative, and load things from the cache whenever possible. tabs.reload() is not, and will generally make a lot of additional requests that a session store load would not. We should probably support this by calling tabs.update() and setting discarded to false. Though I'd really generally prefer that add-ons not do that.
Component: Untriaged → General
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.