I’ve been experimenting with middle clicking all over BB (I use Chrome) since reading this thread, and I haven’t been able to make it do anything other than open links.
Capturing the “onclick” event for a link, and doing something before actually redirecting the link, is actually done all over the place. Discourse isn’t capturing your click, and then redirecting to another website that’s different from target of the link that you’ve clicked (at least, not that I’ve been able to tell) - because if it was, ctrl-clicking would fail in the same way as middle clicking, it would (rightly so) determine this as being shady behaviour. It’s capturing the click, doing something with it, and then directing you to the same link.