--- title: WorkerGlobalScope.ononline slug: Web/API/WorkerGlobalScope/ononline translation_of: Web/API/WorkerGlobalScope/ononline ---
{{APIRef("Web Workers API")}}
La propriété ononline de l'interface {{domxref("WorkerGlobalScope")}} représente un {{event("Event_handlers", "event handler")}} à appeler lorsque l'événement {{event("online")}} survient et se propage à travers le {{domxref("Worker")}}.
self.ononline = function() { ... };
L'extrait de code suivant montre un gestionnaire ononline placé dans un worker :
self.ononline = function() {
console.log('Your worker is now online');
}
| Spécification | Statut | Commentaire |
|---|---|---|
| {{SpecName('HTML WHATWG', "#handler-workerglobalscope-ononline", "WorkerGlobalScope.ononline")}} | {{Spec2('HTML WHATWG')}} |
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.
{{Compat("api.WorkerGlobalScope.ononline")}}
L'interface {{domxref("WorkerGlobalScope")}} à laquelle il appartient.