5👍
✅
The API is only available in browser extensions, not for scripts on the page.
You can see that in the breadcrumbs of the page:
Mozilla > Add-ons > Browser Extensions > JavaScript APIs > i18n > i18n.detectLanguage()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And also the URL:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/detectLanguage
^^^^^^^^^^^^^^^^^^^^^
👤VLAZ
Source:stackexchange.com