Bug 1507352 - Part 1: Ignore the initial about:blank document when handling -screenshot r=mossop
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 15 Nov 2018 20:59:39 +0000
changeset 503103 b7429b8c830dd79220d94186e715a69f30658d37
parent 503102 7fbec497af48b2c2c47db034c3af9fa00736880b
child 503104 61ed0546655a0da158a5b5a1c504105c5b998885
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1507352
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507352 - Part 1: Ignore the initial about:blank document when handling -screenshot r=mossop Differential Revision: https://phabricator.services.mozilla.com/D11969
browser/components/shell/HeadlessShell.jsm
--- a/browser/components/shell/HeadlessShell.jsm
+++ b/browser/components/shell/HeadlessShell.jsm
@@ -25,16 +25,20 @@ function loadContentWindow(webNavigation
         // Ignore inner-frame events
         if (progress != webProgress) {
           return;
         }
         // Ignore events that don't change the document
         if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
           return;
         }
+        // Ignore the initial about:blank
+        if (uri != location.spec) {
+          return;
+        }
         let contentWindow = docShell.domWindow;
         progressListeners.delete(progressListener);
         webProgress.removeProgressListener(progressListener);
         contentWindow.addEventListener("load", (event) => {
           resolve(contentWindow);
         }, { once: true });
       },
       QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",