title: FF Addon SDK page mod script to content script communication not working
body: <p>For starters, I've been trying to allow communication from a page script to a content script. If the docs are accurate, this should be easy. Here's what I'm doing, I believe fully in accordance with <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/content-scripts/communicating-with-other-scripts.html#Using%20the%20DOM%20postMessage%20API" rel="nofollow">https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/content-scripts/communicating-with-other-scripts.html#Using%20the%20DOM%20postMessage%20API</a> :</p>
  
  <p>And here's my live <strong><a href="https://builder.addons.mozilla.org/package/201155/latest/" rel="nofollow">test case</a></strong>:</p>
  
  <p>main.js:</p>
  
  <pre><code>exports.main = function() {
      var data = require('sdk/self').data,
              pageMod = require('sdk/page-mod');
  
      pageMod.PageMod({
          include: '*',
          contentScriptFile: data.url('postMessageRelay.js'),
      });
  };
  </code></pre>
  
  <p>postMessageRelay.js</p>
  
  <pre><code>// Trying with window.addEventListener also doesn't work
  document.defaultView.addEventListener('message', function (e) { // e.data, e.origin
  
      console.log('would be good if it got here:'+e.data);
  
  });
  console.log('it gets here at least');
  </code></pre>
  
  <p>And the JavaScript within a <a href="http://brett-zamir.me/tests/webappfind-test2.html" rel="nofollow">regular HTML file</a> (on a normal remote server, not file or localhost):</p>
  
  <pre><code>try {
      window.postMessage('webappfind', window.location.href);
  }
  catch(e) {
      alert(e);
  }
  </code></pre>
  
  <p>This really looks like either a full-blown bug for this functionality or a problem with the docs... I had similar problems trying to communicate via <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/content-scripts/communicating-with-other-scripts.html#Using%20Custom%20DOM%20Events" rel="nofollow">custom events</a> so going a little bananas...</p>