function handlePortalStatus(portalStatusInfo) {
console.log(`The portal status is now: ${portalStatusInfo.details}`);
}
browser.captivePortal.onStateChanged.addListener(handlePortalStatus);onStateChanged / notebook
onStateChanged
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.