title: Is there any way of passing additional data via custom events?
body: <p>I need to pass data between two autonomic user scripts - ideally without touching the <code>unsafeWindow</code> object - and I thought using custom events would be the way to go. I thought of something like this (let us disregard the MSIE model for the purpose of the example):</p>
  
  <pre><code>addEventListener("customEvent", function(e) {
    alert(e.data);
  });
  
  var custom = document.createEvent("HTMLEvents");
  custom.initEvent("customEvent", true, true);
  custom.data = "Some data...";
  dispatchEvent(custom);
  </code></pre>
  
  <p>This works nicely in the standard Javascript environment and within one user script, but when the event is fired by the user script and caught outside of it or inside another user script, the <code>data</code> property is <code>undefined</code> in Chromium. I suppose I could just save the passed data in the <code>sessionStorage</code>, but it is far from seamless. Any other elegant solutions? Perfection need and can be achieved, I can feel it.</p>