The onlanguagechange
property of the WorkerGlobalScope
interface represents an event handler to be called when the languagechange
event occurs.
self.onlanguagechange = function() { ... };
The following code snippet shows an onlanguagechange
handler set inside a worker:
self.onlanguagechange = function() { console.log('Your preferred language settings have been changed'); }
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
onlanguagechange |
4 |
79 |
74 |
No |
11.5 |
4 |
37 |
40 |
No |
Yes |
5 |
4.0 |
The WorkerGlobalScope
interface it belongs to.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/onlanguagechange