Closed Bug 1282611 Opened 4 years ago Closed 4 years ago
Captive portal not detected at Firefox startup
This was working when I was writing/testing the patch for bug 989193, but something seems to have broken before that landed.
This also changes the patch to use document-shown instead of xul-window-visible, which doesn't seem to work (anymore?) for detecting when the window gains focus. I'll investigate this further later, but meanwhile I wanted to upload this simple patch (having it work at startup makes it much easier to test some stuff). Before requesting review however, I wanted to ask: Valentin, shouldn't nsIOService be doing a recheck at startup already? Doesn't seem to be working, could you take a look? If you can fix it from there this patch won't be necessary (though we should probably do the s/xul-window-visible/document-shown/g change in a separate bug).
Assignee: nobody → nhnt11
Assignee: nhnt11 → nobody
Detection would actually be triggered by the first network activity, so it's a bit racy. You're correct in saying the we should probably do this more reliably, but I think your patch will do for now.
Okay, we don't need to switch to document-shown. That confuses things further since each tab has its own document, etc. A better fix (which this patch does) is to check that Services.ww.activeWindow is the same as whatever getMostRecentBrowserWindow returned. This works right after xul-window-visible, even if the window's document hasn't gotten focus yet. Matt, what do you think?
Attachment #8766599 - Attachment is patch: true
Sorry for the delay, but after coming back from PTO I'm dealing with another bug with high priority. I'll hopefully get to your reviews tomorrow.
Attachment #8766599 - Flags: review?(MattN+bmo) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/fx-team/rev/003319dc7a1f Recheck for captive portal after watcher is initialized. r=MattN
You need to log in before you can comment on or make changes to this bug.