且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Chrome扩展程序检测当前选项卡语言?

更新时间:2023-12-05 19:25:46

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);
  });
});