It doesn't work, because
onclick event doesn't handle middle mouse button.
onmouseup event does, so the event should be replaced from this:
To this:
where
window.open() will open the given link in a new tab (even tested in IE9).
onmouseup event will handle ALL clicks, so you have to make a handling function for the right mouse button. It has to be done together with RMB handling, because it will open a new tab with right click too... orrrr there is a way without making more things.Sorry, but I don't have much time to test it with jQuery, but you can bind function like:
$(document).bind('contextmenu', function(e){
e.preventDefault();
});
or
$(document).bind('mousedown', function(e) {
if( (e.which == 3) ) {
e.preventDefault();
}
});
__________________continuing
To fix the main issue, you have to replace this event for these two generated rows row1p and row2p (I know, the color stuff).
Like this:
There is one important thing to do. When you leave it as it is after my fix, it will open 2 tabs, because there is an Event+a_href.
To prevent opening two tabs, you have to remove the link simply by modyfing the table cell with player name from this:
To this:
This issue is shown from the
https://osu.ppy.sh/p/pp page only.
Every table that contains such links to players should be edited, so it will work for everything.
A list of pages where it should be fixed/replaced:
- Profile link: https://osu.ppy.sh/p/pp
- Profile link: https://osu.ppy.sh/p/chart
- Profile link: https://osu.ppy.sh/p/playerranking
- Country link: https://osu.ppy.sh/p/countryranking <- this page doesn't have coloured rows btw
- Profile link: https://osu.ppy.sh/p/mapperranking
- Profile link: https://osu.ppy.sh/p/modranking <- flags missing? Needs to have changed title?
- Profile link: https://osu.ppy.sh/p/kudosu
- Profile link: https://osu.ppy.sh/s/111865 <- example beatmap_id, goes for beatmap page
Obviously, 'Profile link' stands for '/u/USER_ID' and 'Country link' for '/p/pp?c=FLAG'.
I hope I didn't forget about anything.
Tested it of course and everything works, just found out the double tab issue, so added it to this post.
o/~