Reputation: 4408
Is there a way to use chrome API to detect the language of the current content in the current tab?
Upvotes: 2
Views: 2756
Reputation: 38264
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);
});
});
Upvotes: 4
Reputation: 19290
Yes: chrome.tabs.detectLanguage
. See http://code.google.com/chrome/extensions/tabs.html#method-detectLanguage.
Upvotes: 2