Open Bug 1411603 Opened 3 years ago Updated 5 months ago
Impossible for Web
Extension to detect when FF has done restoring tabs from previous session (new API request)
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20170926190823 Steps to reproduce: My extension needs to make sure there is one particular tab always open. Actual results: When Firefox restores tabs from previous session, it's sometimes done **after** my WebExtension's background script has started. So if I call browser.tabs.query from my background script, it's going to return nothing, because WebExtension has been loaded before FF restored all tabs. Expected results: We need an API (event) that fires when FF has finished restoring all tabs. It could be named "onTabsRestored", "onAllTabsRestored", "onSessionRestored", "onRestored", I'm not sure which one would suit the best. Current workaround is to delay browser.tabs.query call with window.setTimeout, but it's hacky solution and I think not always guarantees success.
Summary: Impossible for WebExtension to detect when FF has done restoring tabs from previous session in WebExtension (new API request) → Impossible for WebExtension to detect when FF has done restoring tabs from previous session (new API request)
See also: bug 1396399
You need to log in before you can comment on or make changes to this bug.