| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 3 source code is governed by a BSD-style license that can be found in the |
| 4 LICENSE file. |
| 5 --> |
| 6 |
| 7 <html> |
| 8 <head> |
| 9 <script> |
| 10 |
| 11 var selectedId = -1; |
| 12 function refreshLanguage() { |
| 13 console.log("refeshing..."); |
| 14 chrome.tabs.getLanguage(null, function(language) { |
| 15 document.getElementById("languageDiv").innerHTML = language; |
| 16 }); |
| 17 } |
| 18 |
| 19 chrome.tabs.onUpdated.addListener(function(tabId, props) { |
| 20 console.log("updated: " + tabId); |
| 21 if (prop.status == "complete" && tabId == selectedId) |
| 22 refreshLanguage(); |
| 23 }); |
| 24 |
| 25 chrome.tabs.onSelectionChanged.addListener(function(tabId, props) { |
| 26 console.log("selection: " + tabId); |
| 27 selectedId = tabId; |
| 28 refreshLanguage(); |
| 29 }); |
| 30 </script> |
| 31 </head> |
| 32 <body onload="refreshLanguage();"> |
| 33 <div id="languageDiv" class="toolstrip-button" onclick="refreshLanguage();"> |
| 34 </div> |
| 35 </body> |
| 36 </html> |
| OLD | NEW |