WorkerGlobalScope.onlanguagechange

The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the languagechange event occurs and bubbles through the Worker.

Syntax

self.onlanguagechange = function() { ... };

Example

The following code snippet shows an onlanguagechange handler set inside a worker:

self.onlanguagechange = function() {
  console.log('Your preferred language settings have been changed');
}

Specifications

Browser compatibility

BCD tables only load in the browser

See also

The WorkerGlobalScope interface it belongs to.