| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 // Called when the user clicks on the browser action. | 4 // Called when the user clicks on the browser action. |
| 5 chrome.browserAction.onClicked.addListener(function(windowId) { | 5 chrome.browserAction.onClicked.addListener(function(tab) { |
| 6 chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"}); | 6 chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"}); |
| 7 }); | 7 }); |
| 8 | 8 |
| 9 chrome.browserAction.setBadgeBackgroundColor([100, 0, 200, 0]); | 9 chrome.browserAction.setBadgeBackgroundColor({color:[100, 0, 200, 0]}); |
| 10 | 10 |
| 11 var i = 0; | 11 var i = 0; |
| 12 window.setInterval(function() { | 12 window.setInterval(function() { |
| 13 chrome.browserAction.setBadgeText(String(i)); | 13 chrome.browserAction.setBadgeText({text:String(i)}); |
| 14 i++; | 14 i++; |
| 15 }, 10); | 15 }, 10); |
| 16 </script> | 16 </script> |
| 17 </head> | 17 </head> |
| 18 </html> | 18 </html> |
| OLD | NEW |