Bug 1896060 - about:support should show correct window count on GeckoView. r=geckoview-reviewers,owlish

Since GeckoView's window name isn't same as Firefox/Desktop, we should count
window number by correct name.

Also, there is no way to write a unit test for Troubleshoot.sys.mjs since
GeckoView doesn't run mochitest-browser unit tests.

Differential Revision: https://phabricator.services.mozilla.com/D210008
This commit is contained in:
Makoto Kato 2024-05-14 06:17:03 +00:00
parent 3989e41645
commit e8c18a0692

View file

@ -267,7 +267,11 @@ var dataProviders = {
data.numTotalWindows = 0;
data.numFissionWindows = 0;
data.numRemoteWindows = 0;
for (let { docShell } of Services.wm.getEnumerator("navigator:browser")) {
for (let { docShell } of Services.wm.getEnumerator(
AppConstants.platform == "android"
? "navigator:geckoview"
: "navigator:browser"
)) {
docShell.QueryInterface(Ci.nsILoadContext);
data.numTotalWindows++;
if (docShell.useRemoteSubframes) {