This API provides the ability detect the captive portal state of the users connection.

Permissions: captivePortal

Not allowed in: Content scripts, Devtools pages

_OnStateChangedDetails
_OnConnectivityAvailableStatus
_OnStateChangedDetailsState
canonicalURL
onConnectivityAvailable
onStateChanged
getLastChecked
getState
_OnConnectivityAvailableStatus: "captive" | "clear"
_OnStateChangedDetailsState:
    | "unknown"
    | "not_captive"
    | "unlocked_portal"
    | "locked_portal"

The current captive portal state.

canonicalURL: Setting

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

onConnectivityAvailable: WebExtEvent<
    (status: _OnConnectivityAvailableStatus) => void,
>

This notification will be emitted when the captive portal service has determined that we can connect to the internet. The service will pass either captive if there is an unlocked captive portal present, or clear if no captive portal was detected.

onStateChanged: WebExtEvent<(details: _OnStateChangedDetails) => void>

Fired when the captive portal state changes.

  • Returns the time difference between NOW and the last time a request was completed in milliseconds.

    Returns Promise<number>