title: Unable to get property 'onMessage' of undefined or null reference in Edge extension content script
body: <p>I'm converting an Chrome extension which works well to Edge extension, and I need to have message listener in my content script. </p>
  
  <p>Here is the code in my content script:</p>
  
  <pre><code>browser.runtime.onMessage.addListener(listener);
  
  function listener(message) {
      console.log(message);
  }
  </code></pre>
  
  <p>However, each time script executes, I get this error, pointing to first line of my content script code:</p>
  
  <pre><code>Unable to get property 'onMessage' of undefined or null reference
  </code></pre>
  
  <p>I've tried changing browser.runtime into chrome.runtime, but nothing changes.</p>
  
  <p>Here I've found that Edge supports runtime.onMessage with some minor incompatibilities:</p>
  
  <p><a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/api-support/supported-apis/" rel="nofollow noreferrer">https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/api-support/supported-apis/</a></p>