title: Binding to an event of the unsafeWindow in Firefox 30 with Greasemonkey 2.0
body: <p>I'm maintaining a Greasemonkey script and got some trouble due to <a href="https://blog.mozilla.org/addons/2014/04/10/changes-to-unsafewindow-for-the-add-on-sdk/" rel="nofollow">Mozilla's change to the unsafeWindow API</a> in Firefox 30.</p>
  
  <p>The page my script runs on, triggers an event "MyEvent" and my script is interested in that event.</p>
  
  <p>The event is fired using jQuery 1.6.4</p>
  
  <p>Before, I used this code to hook into this event:</p>
  
  <pre><code>var jQuery = unsafeWindow.jQuery;
  jQuery(unsafeWindow.document)
      .bind("MyEvent", function() {
          console.log("MyEvent Triggered!");
      });
  </code></pre>
  
  <p>But due to Mozilla's change this won’t work anymore.</p>
  
  <p>I tried to insert my own jQuery in conflict-free mode but I don't think this can access events that are triggered by the other jQuery instance?</p>
  
  <p>Any ideas how I could hook into this event?</p>