getState

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

Syntax

var 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

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getState
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/getState