Bug 1367450 - Defer initialization of CaptivePortalWatcher to just before completion of delayed startup. r=florian
☠☠ backed out by 768208c845b3 ☠ ☠
authorNihanth Subramanya <nhnt11@gmail.com>
Thu, 01 Jun 2017 06:23:10 +0530
changeset 361817 a2b294e575591bf3a25065b2c69c4888c4b6b00d
parent 361785 4a2b5682bddf10d2a9a2ee6d7d67f8391553c06b
child 361818 73465281b97cb8ac0757eb2bab86a744bce637de
push id31945
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 20:42:17 +0000
treeherdermozilla-central@15e32469eb04 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1367450
milestone55.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 1367450 - Defer initialization of CaptivePortalWatcher to just before completion of delayed startup. r=florian MozReview-Commit-ID: 2nqIoDABm0a
browser/base/content/browser-captivePortal.js
browser/base/content/browser.js
--- a/browser/base/content/browser-captivePortal.js
+++ b/browser/base/content/browser-captivePortal.js
@@ -58,18 +58,19 @@ var CaptivePortalWatcher = {
       this._captivePortalDetected();
 
       // Automatically open a captive portal tab if there's no other browser window.
       let windows = Services.wm.getEnumerator("navigator:browser");
       if (windows.getNext() == window && !windows.hasMoreElements()) {
         this.ensureCaptivePortalTab();
       }
     }
-
-    cps.recheckCaptivePortal();
+    else if (cps.state == cps.UNKNOWN) {
+      cps.recheckCaptivePortal();
+    }
   },
 
   uninit() {
     Services.obs.removeObserver(this, "captive-portal-login");
     Services.obs.removeObserver(this, "captive-portal-login-abort");
     Services.obs.removeObserver(this, "captive-portal-login-success");
 
 
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1269,17 +1269,16 @@ var gBrowserInit = {
     gPageStyleMenu.init();
     LanguageDetectionListener.init();
     BrowserOnClick.init();
     FeedHandler.init();
     CompactTheme.init();
     AboutPrivateBrowsingListener.init();
     TrackingProtection.init();
     RefreshBlocker.init();
-    CaptivePortalWatcher.init();
     FullZoomUI.init(window);
 
     let mm = window.getGroupMessageManager("browsers");
     mm.loadFrameScript("chrome://browser/content/tab-content.js", true);
     mm.loadFrameScript("chrome://browser/content/content.js", true);
     mm.loadFrameScript("chrome://browser/content/content-UITour.js", true);
     mm.loadFrameScript("chrome://global/content/manifestMessages.js", true);
 
@@ -1712,16 +1711,18 @@ var gBrowserInit = {
     gBrowser.tabContainer.addEventListener("TabSelect", function() {
       for (let panel of document.querySelectorAll("panel[tabspecific='true']")) {
         if (panel.state == "open") {
           panel.hidePopup();
         }
       }
     });
 
+    CaptivePortalWatcher.init();
+
     this.delayedStartupFinished = true;
 
     _resolveDelayedStartup();
     Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
     TelemetryTimestamps.add("delayedStartupFinished");
   },
 
   // Returns the URI(s) to load at startup.