Bug 1397232 - Use the hidden window to report media telemetry. r=florian
A normal window might not exist when this is called, for example on Mac where it's possible to close all windows but not the application. This has been true since
bug 1362212 moved it to an idle observer.
MozReview-Commit-ID: EcL941XKTeP
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -919,17 +919,17 @@ BrowserGlue.prototype = {
PageActions.init();
this._firstWindowTelemetry(aWindow);
this._firstWindowLoaded();
},
_sendMediaTelemetry() {
- let win = RecentWindow.getMostRecentBrowserWindow();
+ let win = Services.appShell.hiddenDOMWindow;
let v = win.document.createElementNS("http://www.w3.org/1999/xhtml", "video");
v.reportCanPlayTelemetry();
},
/**
* Application shutdown handler.
*/
_onQuitApplicationGranted() {