1 // Copyright 2014 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.
5 // Set a background color for the badge at OnInstalled().
6 chrome
.runtime
.onInstalled
.addListener(function() {
7 chrome
.browserAction
.setBadgeBackgroundColor({color
: [0, 0, 255, 255]});
8 chrome
.test
.sendMessage('Background Color Set');
11 // Every startup, change the badge text, but not the background color (which
12 // should persist at the blue we set originally).
13 chrome
.runtime
.onStartup
.addListener(function() {
14 chrome
.browserAction
.setBadgeText({text
: 'Hello'});
15 chrome
.test
.sendMessage('Badge Text Set');