forum

[confirmed] [web] Middle click doesn't work properly on ranking page

posted
Total Posts
9
Topic Starter
BrokenArrow
When you middle-click on a player's name on the ranking page, a new tab with the player's profile page opens (like it's supposed to do). However, under the newest version of Google Chrome (32.0.1700.76 m) the current page switches to the player's profile too. This problem doesn't occur under Firefox 26.
Hineya
Same here.
TheVileOne
I cannot replicate this issue. I just updated to Version 32.0.1700.102 m.
Jools
I just replicated this. I went to the performance rankings (https://osu.ppy.sh/p/pp) and middle clicked on rrtyui's name and it opened his profile in a new tab and also opened it on the tab I was originally on.

EDIT: Tried it out on song rankings (https://osu.ppy.sh/b/290581?m=0) and it only opened the profile in a new tab, not in my current one.
TheVileOne
Replicated.
MillhioreF
This isn't a new issue; I've been having this problem as early as a couple months ago. Perhaps it's existed since the current ranking page layout has?
DarkStoorM
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:


  • BUT
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:


  • IMPORTANT!
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:
  1. Profile link: https://osu.ppy.sh/p/pp
  2. Profile link: https://osu.ppy.sh/p/chart
  3. Profile link: https://osu.ppy.sh/p/playerranking
  4. Country link: https://osu.ppy.sh/p/countryranking <- this page doesn't have coloured rows btw
  5. Profile link: https://osu.ppy.sh/p/mapperranking
  6. Profile link: https://osu.ppy.sh/p/modranking <- flags missing? Needs to have changed title?
  7. Profile link: https://osu.ppy.sh/p/kudosu
  8. 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/~
Hemmi
Can you please fix that? A solution was even proposed by DarkStoorM !!
DarkStoorM

Gunsillie wrote:

.
Wow man, it's a 1-year old thread. I'm not even sure if such thing would work now ;p

If something is in a low-priority, it will get fixed some day, don't worry!
Please sign in to reply.

New reply