Closed Bug 1565536 Opened 1 year ago Closed 8 months ago

Ensure that new GeckoSessions are correctly marked as active ( docShellIsActive )


(GeckoView :: Extensions, defect, P3)



(firefox70 affected)

Tracking Status
firefox70 --- affected


(Reporter: robwu, Unassigned)


(Blocks 2 open bugs)


When I call from a mochitest, the opened page appears to be visible in the foreground, yet its browser.docShellIsActive is false. Consequently, extensions are unable to identify the active tab in mochitests in GeckoView (as they rely on it, in ext-utils.js via tab.getActive.

This unexpected behavior is not limited to TestRunnerActivity (which is used by mochitest). When I call from a webpage in geckoview_example, then the urlbar is updated, but the content is not, and browser.docShellIsActive is also false.

Currently GeckoView’s setSession seems responsible for marking a session as active, via the "GeckoView:SetActive" message, which ends up setting docShellIsActive.

My interest in this originates from the the attempt to support the active property in the tabs API, but as the last link above shows, there is more to the "GeckoView:SetActive" message than just setting the docShellIsActive flag.

If we are mainly interested in docShellIsActive, then setting it when necessary would work (rpl suggested that we may be able to set it at the end of startup in geckoview.js).
If the only concern is the "active" flag of the tabs API, then there are also other hacks, such as noticing that a tab is currently only active iff its window equals Services.wm.getMostRecentBrowserWindow() (relying on this looks like a hack though).

Priority: -- → P3
Blocks: 1543755
See Also: → 1581661
Blocks: 1507167

Those tests are currently disabled because is not implemented:,33,38,40

The immediate cause for the test timeouts is that the implementation throws when BrowserApp.selectTab is called:
(for the stack trace, see

The BrowserApp.selectTab call must be replaced, but that depends on the ability to change and query active tabs, which is the subject of this bug.

Mass moving bugs to the Extension component.

Component: General → Extensions
See Also: → 1616625

We decoupled docShellIsActive and the active property of the WebExtension API in Bug 1597793 so this bug should not be relevant anymore as apps have full control on whatever tab is the current active tab (including the test runner which sets it here:

Closed: 8 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.