From a489431ca6963cee527adc27ef61291580f8a4a7 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Sat, 26 Jan 2019 06:08:50 +0200 Subject: [PATCH] Backed out changeset 34e24b0fb7b7 (bug 1522989) for ESLint failures. --- browser/components/shell/HeadlessShell.jsm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/browser/components/shell/HeadlessShell.jsm b/browser/components/shell/HeadlessShell.jsm index ba1a56386c8b..962a12d221de 100644 --- a/browser/components/shell/HeadlessShell.jsm +++ b/browser/components/shell/HeadlessShell.jsm @@ -13,19 +13,12 @@ ChromeUtils.import("resource://gre/modules/osfile.jsm"); // before they are called. const progressListeners = new Map(); -function loadContentWindow(webNavigation, url, principal) { - let uri; - try { - uri = Services.io.newURI(url); - } catch (e) { - Cu.reportError(`Invalid URL passed to loadContentWindow(): ${url}`); - return; - } +function loadContentWindow(webNavigation, uri, principal) { return new Promise((resolve, reject) => { let loadURIOptions = { triggeringPrincipal: principal, }; - webNavigation.loadURI(uri.spec, loadURIOptions); + webNavigation.loadURI(uri, loadURIOptions); let docShell = webNavigation.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDocShell); let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor) @@ -41,7 +34,7 @@ function loadContentWindow(webNavigation, url, principal) { return; } // Ignore the initial about:blank - if (uri.spec != location.spec) { + if (uri != location.spec) { return; } let contentWindow = docShell.domWindow;