From 84e0c25849b4e029b8208769986ee9817f0ae0fe Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 15 Apr 2017 14:09:41 -0700 Subject: [PATCH] Bug 1356826: Part 6 - Wait for delayed startup before checking for side-loads. r=aswan MozReview-Commit-ID: IpuRNbdUXmE --HG-- extra : rebase_source : 0fc72897bc0a12b5bd789c9a0d00df3dec4f7760 extra : source : d47998fa24cd084ffba07a73834d8ffb3af81b60 --- browser/base/content/browser.js | 6 ++++++ browser/modules/ExtensionsUI.jsm | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 462ec2d1ecb9..6c5f3718f076 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1143,6 +1143,11 @@ addEventListener("DOMContentLoaded", function onDCL() { gBrowser.updateBrowserRemoteness(initBrowser, gMultiProcessBrowser); }); +let _resolveDelayedStartup; +var delayedStartupPromise = new Promise(resolve => { + _resolveDelayedStartup = resolve; +}); + var gBrowserInit = { delayedStartupFinished: false, @@ -1605,6 +1610,7 @@ var gBrowserInit = { this.delayedStartupFinished = true; + _resolveDelayedStartup(); Services.obs.notifyObservers(window, "browser-delayed-startup-finished"); TelemetryTimestamps.add("delayedStartupFinished"); }, diff --git a/browser/modules/ExtensionsUI.jsm b/browser/modules/ExtensionsUI.jsm index fb1e649aa2c2..e103beea4d50 100644 --- a/browser/modules/ExtensionsUI.jsm +++ b/browser/modules/ExtensionsUI.jsm @@ -35,7 +35,7 @@ this.ExtensionsUI = { sideloadListener: null, histogram: null, - init() { + async init() { this.histogram = Services.telemetry.getHistogramById("EXTENSION_INSTALL_PROMPT_RESULT"); Services.obs.addObserver(this, "webextension-permission-prompt"); @@ -43,6 +43,8 @@ this.ExtensionsUI = { Services.obs.addObserver(this, "webextension-install-notify"); Services.obs.addObserver(this, "webextension-optional-permission-prompt"); + await RecentWindow.getMostRecentBrowserWindow().delayedStartupPromise; + this._checkForSideloaded(); },