1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 function refreshLanguage() {
7 chrome.tabs.detectLanguage(null, function(language) {
9 if (language == " invalid_language_code")
11 chrome.browserAction.setBadgeText({"text": language, tabId: selectedId});
15 chrome.tabs.onUpdated.addListener(function(tabId, props) {
16 if (props.status == "complete" && tabId == selectedId)
20 chrome.tabs.onSelectionChanged.addListener(function(tabId, props) {
25 chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
26 selectedId = tabs[0].id;