title: What is the purpose of background.js on a chrome extension?
body: <p>I don't see use for background.js or background.html just yet. It seems like just a middle man. I can easily communicate with all my content scripts by using the following code in popup.html/popup.js (browser action): </p>
  
  <pre><code>if (e.target.id === "blue"){
     chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
       var activeTab = tabs[0];
      chrome.tabs.sendMessage(activeTab.id, {"message": "blue" });
  });
  }
  </code></pre>
  
  <p>then on my content.js : </p>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
  
   if( request.message === "blue" ) {
       document.body.style.backgroundColor="blue";
       console.log("Content: Changing to blue");
   }
  
   if( request.message === "black" ) {
       document.body.style.backgroundColor="black";
  }
  
   });
  </code></pre>
  
  <p>P.S Hope this helps someone out, I already have a working extension ! :D </p>