- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / examples / api / browserAction / make_page_red / background.js
1 // Copyright (c) 2011 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.
4
5 // Called when the user clicks on the browser action.
6 chrome.browserAction.onClicked.addListener(function(tab) {
7   // No tabs or host permissions needed!
8   console.log('Turning ' + tab.url + ' red!');
9   chrome.tabs.executeScript({
10     code: 'document.body.style.backgroundColor="red"'
11   });
12 });