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 answers

3
Digital Plane 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
Daniel Brockman On