Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect page language/locale in a Chrome extension content script?

I would like my Chrome extension content script to detect the language or locale of the page's content (not the browser language/locale). I assume there is a method for this in the Chrome extension API, but should I be using standard Javascript libraries instead?

like image 733
Jacob Marble Avatar asked Oct 20 '25 03:10

Jacob Marble


1 Answers

This is the Chrome extension method: chrome.tabs.detectLanguage(...). From the description:

Detects the primary language of the content in a tab.

like image 179
Jacob Marble Avatar answered Oct 21 '25 22:10

Jacob Marble



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!