title: How to listen to custom events on all windows, bubbling issue?
body: <p>I'm trying to listen to custom event 'peakAhBoo' so I add the event listener to <code>gBrowser</code> and if no <code>gBrowser</code> is present then I add it to <code>aDOMWindow</code> (<a href="https://gist.github.com/Noitidart/9288991" rel="nofollow">gist</a>).</p>
  
  <p>Code snippet:</p>
  
  <pre><code>loadIntoWindow: function (aDOMWindow, aXULWindow) {
    if (!aDOMWindow) {
      return;
    }
    if (aDOMWindow.gBrowser) {
      aDOMWindow.gBrowser.addEventListener('peakAhBoo', respondToCustomEvent_peakAhBoo, true);
    } else {
      aDOMWindow.addEventListener('peakAhBoo', respondToCustomEvent_peakAhBoo, true);
    }
  },
  </code></pre>
  
  <p>Code to dispatch event:</p>
  
  <pre><code>var myEvent = new CustomEvent('peakAhBoo', {
      'detail': {
          'hazcheeseburger': true
      }
  });
  var myEvent = window.document.createEvent('CustomEvent');
  var myEventDetail = {hello:'world'};
  myEvent.initCustomEvent('peakAhBoo', true, true, myEventDetail);
  window.dispatchEvent(myEvent);
  </code></pre>
  
  <p>However if I open scratchpad and run this create/dispatch event code from environment content, its not bubbling up to <code>gBrowser</code>. If I run it in browser environment it never hits the window.</p>