captivePortal

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.

Properties

captivePortal.canonicalURL

Return the canonical URL of the captive-portal detection page. Read-only.

Functions

captivePortal.getLastChecked()

Returns the time, in milliseconds, since the last request was completed.

captivePortal.getState()

Returns the portal state as one of unknown, not_captive, unlocked_portal, or locked_portal.

Events

captivePortal.onConnectivityAvailable

Fires when the captive portal service determines that the user can connect to the internet.

captivePortal.onStateChanged

Fires when the captive portal state changes.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
captivePortal
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
canonicalURL
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
getLastChecked
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
getState
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
onConnectivityAvailable
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
onStateChanged
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support