Open
Bug 1466904
Opened 6 years ago
Updated 2 years ago
Add API to wake up a discarded tab
Categories
(WebExtensions :: General, enhancement, P3)
WebExtensions
General
Tracking
(Not tracked)
NEW
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.
Updated•6 years ago
|
Blocks: tab-unloading
Depends on: 1322485
Comment 1•6 years ago
|
||
You can use: browser.tabs.reload(tab.id, {});
See this addon:
https://addons.mozilla.org/firefox/addon/tabpreloader/
https://github.com/jmozmoz/tabPreLoader/blob/master/src/background.js#L102
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Comment 2•6 years ago
|
||
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
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•