onStateChanged
S'allume lorsque l'état de portail captif change.
Syntaxe
js
browser.captivePortal.onStateChanged.addListener(callback);
browser.captivePortal.onStateChanged.removeListener(listener);
browser.captivePortal.onStateChanged.hasListener(listener);
Les événements ont trois fonctions :
addListener(callback)
-
Ajoute un auditeur à cet événement.
removeListener(listener)
-
Arrêtez d'écouter cet événement. L'argument de
listener
est l'auditeur à retirer. hasListener(listener)
-
Vérifiez si
listener
est inscrit à cet événement. Renvoietrue
si c'est un auditeur, sinonfalse
.
Syntaxe addListener
Paramétres
Exemples
Gérer un changement de statut de portail captif :
js
function handlePortalStatus(portalstatusInfo) {
console.log("The portal status is now: " + portalstatusInfo.details);
}
browser.captivePortal.onStateChanged.addListener(handlePortalStatus);
Compatibilité des navigateurs
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
onStateChanged |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.