title: Chrome Extension: Change background Color on pageLoad
body: <p>I'm trying to change the background color of web page onLoad.
  But, the script is not being executed
  Here is my code.</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
    "name": "Page Redder",
    "description": "Make the current page red",
    "version": "2.0",
    "permissions": [
      "activeTab"
    ],
    "background": {
      "scripts": ["background.js"],
      "persistent": false
    },
    "browser_action": {
      "default_title": "Make this page red"
    },
    "manifest_version": 2
  }
  </code></pre>
  
  <p>background.js</p>
  
  <pre><code>chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
  if (changeInfo.status == 'complete')
          chrome.tabs.executeScript(tabId, {file:"code.js"});
  });
  
  chrome.browserAction.onClicked.addListener(function(tab) {
  chrome.tabs.executeScript({
      code: 'document.body.style.backgroundColor="green"'
  });
  });
  </code></pre>
  
  <p>code.js</p>
  
  <pre><code>document.body.style.backgroundColor="red"
  </code></pre>
  
  <p>It is working when I click on the Extension Icon. But, <code>code.js</code> is not being executed.</p>