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