title: Making chrome extension and chrome.runtime.onMessage isn't receiving the message
body: <p>Here is the code in my event page:</p>
  
  <pre><code>chrome.runtime.onInstalled.addListener(function (){
      chrome.contextMenus.create
          ({
              "title": "Test",
              "contexts": ["all"],
              "id": "menu"
          });
      chrome.contextMenus.create
          ({
              "title": "Dummy",
              "contexts": ["all"],
              "id": "dummy",
              "parentId": "menu"
          });
  });
  
  chrome.contextMenus.onClicked.addListener(onClickHandler);
  
  function onClickHandler (info, tab) {
      if(info.menuItemId == "dummy"){
          chrome.tabs.sendMessage(tab.id, {greeting: "hello"}, function(response) {
              console.log(response.farewell);
          });  
      }
  }
  </code></pre>
  
  <p>And here is the code in my content script straight from the chrome message passing documentation:</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(
    function(request, sender, sendResponse) {
      console.log(sender.tab ?
                  "from a content script:" + sender.tab.url :
                  "from the extension");
      if (request.greeting == "hello")
        sendResponse({farewell: "goodbye"});
    });
  </code></pre>
  
  <p>The onClickHandler in the event page is being triggered, but it seems like the sendMessage method isn't working. The onMessage listener isn't receiving any information, so it doesn't log anything to the console or even send a response. This causes the original sendMessage callback to throw an exception because response.farewell isn't even defined. Does anybody know why the code doesn't seem to work.</p>
  
  <p>The error:</p>
  
  <pre><code>Error in event handler for (unknown): TypeError: Cannot read property 'farewell' of undefined
  </code></pre>