MDN self-hosted library · e01.org

captivePortal.getState()

Returns the portal state as one of unknown, notcaptive, unlockedportal, or lockedportal.

no runnable cells webextension-api-function upstream source

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

Syntax

let state = browser.captivePortal.getState()

Return value

A Promise that is fulfilled with a string containing one of unknown, not_captive, unlocked_portal, or locked_portal.

Browser compatibility