Open sfleiter opened 5 years ago
Forgot to mention: Solution 2 above (Tab.lastAccessed) would actually allow to remove the existing code for remembering last active time of tabs and the need to save that in sessionstore. This would automatically fix issue #36. Additionally Tab.lastAccessed has the semantics I proposed above, it includes the whole time until tab is left.
Only downside is that this is Firefox specific.
Dormancy today accounts a tab, that is not the current tab of the browser window, as active exactly at the point in time it was switched to. This time is remembered and compared to in
tabIsOld(tabId)
. With a Dormancy timeout of 10 minutes today a tab that is active for 9 minutes and 59 seconds can, after a switch to another tab, be discarded the next second.For me a tab is active from the activation time until another tab is activated. In the above example the tab would not be discarded earlier than 10 minutes after it was switched away from.
I see different ways of doing this (and have code already for this):
tabs.onActivated
in Firefox 65. Real documentation is still missing, see dev-doc-needed in https://bugzilla.mozilla.org/show_bug.cgi?id=1500479.Depending on decission for issue #34 the optimal solution might be different, previousTabId and Tab.lastAccessed are Firefox specific.