Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: chrome/test/data/extensions/samples/make_page_red/background.html

Issue 256032: Add an API to manipulate the browser action badge. (Closed)
Patch Set: meet halfway Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/extension_action.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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(windowId) {
6 chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"}); 6 chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"});
7 }); 7 });
8
9 chrome.browserAction.setBadgeBackgroundColor([100, 0, 200, 0]);
10
11 var i = 0;
12 window.setInterval(function() {
13 chrome.browserAction.setBadgeText(String(i));
14 i++;
15 }, 10);
8 </script> 16 </script>
9 </head> 17 </head>
10 </html> 18 </html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_action.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698