Open Bug 1865366 Opened 11 months ago Updated 11 months ago

Support observing "discarded" changes in tabs.onUpdated

Categories

(GeckoView :: Extensions, enhancement)

All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

(Depends on 2 open bugs)

Details

(Whiteboard: [addons-jira])

The tabs.onUpdated event should be fired when the "discarded" state of a tab changes:

  • (depends on bug 1402338) When tabs.discard is called, discarded:false should become discarded:true
  • (depends on bug 1583281) When a discarded tab is re-activated, whether by the user or by extension APIs: whether directly (tabs.update(tabId, {active:true})) or indirectly (tabs.remove(otherTabId) that results in the discarded tab being focused).
  • When the tab's content is unloaded, e.g. due to memory pressure, observed through A-C.

Note: I marked bug 1402338 and bug 1583281 as dependencies, but it is also possible to resolve this bug first, by testing against the third scenario, and then adding unit tests for the other scenarios later. In fact, it would probably be easier to write a "cross-platform" mochitest if this bug were to be resolved before the others.

Another note: on desktop it's currently possible to add a filter to the tabs.onUpdated event to limit the event dispatch to specific changes only. That is currently not implemented on Android (bug 1713819).

You need to log in before you can comment on or make changes to this bug.