TimelineExtension
TimelineExtension copied to clipboard
Every tab re-submitted when restoring sessions
- Set your browser to restore tabs from last session on startup
- Open a few choice web pages in different tabs
- Restart the browser
- Wait 8 seconds
Expected: Only newly opened tabs should be sent to Timeline.
Actual: Every tab from the previous session is resubmitted at the same time.
How would we go about implementing this?
Block submissions for non-active tabs for the first 30 seconds after startup except for active/focused tabs. The tab
object is available as the sendMessage
sender so you can check which tab is active there without requeing tabs
permission or complexity. Just add a boolen in background.ja called allowBackgroundTabSubmissions
set to false, and flip it to true after a timeout.
Would normally submit background tabs, but just inoring these at startup should fix this issue. If the first thing you do is open a page and open ten background tabs, you might loose some submissions. Could also look at the tab creation time; I believe that is also available in the tab
object.
Was about to make an issue about this for pinned tabs as well as what you mentioned when Chrome restores the tabs you had open last.