Closed Bug 1545159 Opened 8 months ago Closed 7 months ago

Expose captive portal status

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: mixedpuppy, Assigned: mixedpuppy)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

We need to possibly handle proxy in some unique fashion when the browser is behind a captive portal. TBD

Probably the best place to expose this is on browserSettings[1], but possibly on proxy.settings.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings

Bugbug thinks this bug is a task, but please change it back in case of error.

Type: defect → task
Type: task → enhancement
Priority: -- → P2
Assignee: nobody → mixedpuppy

:mconca fyi on new api for secure proxy support. I think this is generically useful for other proxy extensions, probably others, in order to know the captive portal state. I have not required mozillaAddons for this. The API provides current state and event listeners to watch for state changes.

Flags: needinfo?(mconca)

:mixedpuppy I agree that there are use cases. Any privacy concerns? Does knowing if a user is going through a captive portal indicate they are away (cafe, hotel, etc.) versus on a dedicated home/work network? Does that matter?

Flags: needinfo?(mconca) → needinfo?(mixedpuppy)

:mconca, Apparently you can detect captive portals without this, they already have code for it (this was low priority, but super easy to do). Given that, I don't think we're exposing anything new. So, the point of exposing this is to reduce that duplication in the extension and ensure the behavior is consistent with what Firefox does internally.

Flags: needinfo?(mixedpuppy)

(In reply to Shane Caraveo (:mixedpuppy) from comment #5)

:mconca, Apparently you can detect captive portals without this, they already have code for it (this was low priority, but super easy to do). Given that, I don't think we're exposing anything new. So, the point of exposing this is to reduce that duplication in the extension and ensure the behavior is consistent with what Firefox does internally.

+1 for making this public

(In reply to Shane Caraveo (:mixedpuppy) from comment #5)

:mconca, Apparently you can detect captive portals without this, they already have code for it (this was low priority, but super easy to do). Given that, I don't think we're exposing anything new. So, the point of exposing this is to reduce that duplication in the extension and ensure the behavior is consistent with what Firefox does internally.

You are right, we do not expose anything new. Our captive portal detection only detects that a captive portal redirects request to a log-in page or an agree-on-term-of-servces page. An extension can detect the same redirect if it sends a request early-enough, before the user enters password, accept the term of service, etc.

Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57598d1d033f
implement captivePortal api r=rpl,valentin
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Duplicate of this bug: 1341460

Can you please provide some STR for this issue so we can check it manually? If no manual testing is needed please mark it as "qe-verify- "

Flags: needinfo?(mixedpuppy)
Flags: needinfo?(mixedpuppy) → qe-verify-

Looks like this wasn't documented yet, can we make that happen?

Keywords: dev-doc-needed

I would also be interested in seeing this documented on MDN. We want to detect captive portals for some DNS-over-HTTPS related work.

Could I get some details on what needs to be documented?

Flags: needinfo?(mixedpuppy)

Documentation I believe is at least in part generated based on the schema, then further crafted.

https://searchfox.org/mozilla-central/source/toolkit/components/extensions/schemas/captive_portal.json

The test can sometimes also help in generating any example.

https://searchfox.org/mozilla-central/source/toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js

Flags: needinfo?(mixedpuppy)

Review and feedback of draft of the MDN content sought. Thanks!

Flags: needinfo?(philipp)
Flags: needinfo?(mixedpuppy)

In addition to feedback on the API page content, opinions on the need for a web extension example are also sought.

That all seems reasonable. I don't think we need a full example.

Flags: needinfo?(mixedpuppy)

Looks good to me as well!

Flags: needinfo?(philipp)
Depends on: 1599205
You need to log in before you can comment on or make changes to this bug.