Detecting the current tab language using Chrome extension?

2.6k Views Asked by At

Is there a way to use chrome API to detect the language of the current content in the current tab?

2

There are 2 best solutions below

3
On BEST ANSWER

Use the Chrome Tabs API to select the current tab, then get the language.

Sample usage:

//Get language of current tab
chrome.tabs.getSelected(null, function(tab) {
  chrome.tabs.detectLanguage(tab.id, function(language) {
    console.log(language);
  });
});
1
On