title: How to hook to custom javascript trigger when using IJavaScriptExecutor
body: <p>We have this event define in our web application, that creates a custom trigger called <code>timelineEventClicked</code> </p>
  
  <pre><code>canvas.addEventListener('click', function (evt) {
                      evt.stopImmediatePropagation();
                      var mousePos = getMousePos(canvas, evt);
  
                          ...//some manipulation here
  
                          $.event.trigger({
                              type: "timelineEventClicked",
                              sender: _timelineObject,
                              events: settings.events,
                              eventData: eventData
                          });
                      });
  </code></pre>
  
  <p>I would like to hook to this event  <code>timelineEventClicked</code> and get back the <code>eventData</code> using selenium or protractor by injecting </p>
  
  <pre><code>IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;
   executor.ExecuteScript(@"(function() {                       
                      document.addEventListener('timelineEventClicked', function(e) {
                          //Not sure what to do here to get back evendata
                  })();"
                  );
  </code></pre>
  
  <p>The problem is that it doesn't seems to recognize the event <code>timelineEventClicked</code> and not sure why.</p>