title: Opening a custom URL in new tab from a middle click in Firefox
body: <p>So, currently I have a script which intercepts any mouse clicks on  tags, modifies the outgoing link, and sends users on their way:</p>
  
  <pre><code>$("a[href*='" + someDomain + "']").bind('click keypress', function(event) {
      event.preventDefault();
      var link = this.href;
      var newLink = link + params;
      var button = event.button;
      if(button &amp;&amp; button == 0)) {
          window.location = newLink;
      } else if(button &amp;&amp; button === 1) {
          window.open(newLink, '_blank');
      }
  });
  </code></pre>
  
  <p>This code will determine if it was a left click or middle click, and either redirect current page, or open in a new window/tab accordingly.</p>
  
  <p>Code works fine in Chrome/IE as far as I can see. However, in the latest version of Firefox, only left click is working.</p>
  
  <p>For a middle click, the event is not registered. So, my first thought was to look into what other event must be getting triggered. The only one I could find was either a mousedown/mouseup (click is a combination of these).</p>
  
  <p>Using mousedown or mouseup, I then get the event to properly register a middle click in Firefox. HOWEVER, the problem then becomes that Firefox will refuse to open any new windows from javascript code that is not the result of a CLICK event.</p>
  
  <p>So.... any clue if this is actually possible? I'd rather not make the user have to allow popups, or re-map their middle click function to open in the current window.</p>
  
  <p>Thanks in advance for any help!</p>