The behavior of this is quite variable by browser. See https://code.google.com/p/chromium/issues/detail?id=255#c106 . According to that, of the ones you asked about:
"IE doesn't fire a click event if the target is a link, but does fire it if another element is clicked even if it's a descendant of a link."
"Gecko always fires a click event on the document that bubbles and has as target the element being clicked."
For Firefox, thus you can do:
$( document ).click(
function ( evt ) {
// ... evt.which === 2 means middle click
}
);
which is kind of a trick (normally you would listen to events on the link itself), but it works.