Bug 1282611 - Recheck for captive portal after watcher is initialized. r=MattN

MozReview-Commit-ID: DKUibGPvTrx
This commit is contained in:
Nihanth Subramanya 2016-06-27 16:09:23 -07:00 коммит произвёл Panos Astithas
Родитель c470de115e
Коммит d201f3429d
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -47,10 +47,14 @@ this.CaptivePortalWatcher = {
Services.obs.addObserver(this, "captive-portal-login-abort", false);
Services.obs.addObserver(this, "captive-portal-login-success", false);
this._initialized = true;
if (cps.state == cps.LOCKED_PORTAL) {
// A captive portal has already been detected.
this._addCaptivePortalTab();
return;
}
cps.recheckCaptivePortal();
},
uninit() {
@ -110,8 +114,8 @@ this.CaptivePortalWatcher = {
}
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win.document.hasFocus()) {
// The document that got focused was not in a browser window.
if (win != Services.ww.activeWindow) {
// The window that got focused was not a browser window.
return;
}
Services.obs.removeObserver(this, "xul-window-visible");