title: chrome.runtime.sendMessage not working
body: <p>I'm creating a chrome extension, and I'm running into this really annoying problem. I would like to send a message from my content script to the background and send a response back.</p>
  
  <p>I keep getting this error:</p>
  
  <blockquote>
    <p>Port: Could not establish connection. Receiving end does not exist</p>
  </blockquote>
  
  <p>I'm currently using this code.</p>
  
  <p>background:</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){
      sendResponse("got it!");
  });
  </code></pre>
  
  <p>content script:</p>
  
  <pre><code>chrome.runtime.sendMessage(&lt;extension id&gt;, "test message", function(response){
      console.log(response);
  });
  </code></pre>
  
  <p>I'm using chrome version 30.0.1599.69 m.</p>