Closed Bug 1282611 Opened 4 years ago Closed 4 years ago

Captive portal not detected at Firefox startup

Categories

(Firefox :: General, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 51
Tracking Status
firefox50 --- affected
firefox51 --- fixed

People

(Reporter: nhnt11, Assigned: nhnt11)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxprivacy])

Attachments

(1 file, 1 obsolete file)

This was working when I was writing/testing the patch for bug 989193, but something seems to have broken before that landed.
Attached patch Patch (obsolete) — Splinter Review
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
Flags: needinfo?(valentin.gosu)
Assignee: nhnt11 → nobody
Blocks: 1202680
Priority: -- → P3
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.
Flags: needinfo?(valentin.gosu)
Attached patch Patch v2Splinter Review
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?
Assignee: nobody → nhnt11
Attachment #8765651 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8766599 - Flags: review?(MattN+bmo)
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 pastithas@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/003319dc7a1f
Recheck for captive portal after watcher is initialized. r=MattN
https://hg.mozilla.org/mozilla-central/rev/003319dc7a1f
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
You need to log in before you can comment on or make changes to this bug.