From 6e982ab4d4ed47fd91efb799b70816e52904b7cb Mon Sep 17 00:00:00 2001 From: Nihanth Subramanya Date: Thu, 1 Jun 2017 06:23:10 +0530 Subject: [PATCH] Bug 1367450 - Defer initialization of CaptivePortalWatcher to just before completion of delayed startup. r=florian MozReview-Commit-ID: I9NKOYEYc5g --HG-- extra : rebase_source : 156974e79c638bbbd2d6fc73ee9bde3490f2028f --- browser/base/content/browser-captivePortal.js | 4 ++-- browser/base/content/browser.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/base/content/browser-captivePortal.js b/browser/base/content/browser-captivePortal.js index df20150cf87c..bae32f4592ca 100644 --- a/browser/base/content/browser-captivePortal.js +++ b/browser/base/content/browser-captivePortal.js @@ -62,9 +62,9 @@ var CaptivePortalWatcher = { if (windows.getNext() == window && !windows.hasMoreElements()) { this.ensureCaptivePortalTab(); } + } else if (cps.state == cps.UNKNOWN) { + cps.recheckCaptivePortal(); } - - cps.recheckCaptivePortal(); }, uninit() { diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 9efb75df6a7a..f2fb61b73364 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1274,7 +1274,6 @@ var gBrowserInit = { AboutPrivateBrowsingListener.init(); TrackingProtection.init(); RefreshBlocker.init(); - CaptivePortalWatcher.init(); FullZoomUI.init(window); let mm = window.getGroupMessageManager("browsers"); @@ -1717,6 +1716,8 @@ var gBrowserInit = { } }); + CaptivePortalWatcher.init(); + this.delayedStartupFinished = true; _resolveDelayedStartup();