Determine the captive portal state of the user’s connection. A captive portal is a web page displayed when a user first connects to a Wi-Fi network. The user provides information or acts on the captive portal web page to gain broader access to network resources, such as accepting terms and conditions or making a payment.
To use this API you need to have the "captivePortal" permission.
captivePortal.canonicalURL
captivePortal.getLastChecked()
captivePortal.getState()
unknown
, not_captive
, unlocked_portal
, or locked_portal
.captivePortal.onConnectivityAvailable
captivePortal.onStateChanged
Fires when the captive portal state changes.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
canonicalURL |
No |
No |
72 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
getLastChecked |
No |
No |
68 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
getState |
No |
No |
68 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
onConnectivityAvailable |
No |
No |
68 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
onStateChanged |
No |
No |
68 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/captivePortal