Csardelacal / YCH-Issues

Issue tracking for YCH.commishes.com
1 stars 0 forks source link

CRM. Middle and right click on a link in conversations with Mozilla Firefox #33

Closed nokitakaze closed 3 years ago

nokitakaze commented 5 years ago

I always set up many links in my references, but links on https://crm.commishes.com/ does not work correcly in Mozilla Firefox. They redirect user if he used middle or right click on a link. But it is very wrong way, because you are breaking user experience. Right click should open context menu, middle click should open link on other tab in browser

I know what are you trying to do, you are trying to hide reference URL because sometimes it contains unique seed https://crm.commishes.com/task/show/123456/?s=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX This is good decision, but you use wrong way to do it.

I just checked, middle/right clicks does not redirect me if I use Google Chrome. As I could see you use this to handle clicks.

if (document.addEventListener) { document.addEventListener('click', listener, false); }
else                           { document.attachEvent('onclick', listener); }

It means if I use middle/right click in Google Chrome, I will not use your /redirect/?url, so my URL will be seen as Referer: ...

In my ECM, where URLs contain family and given names of our clients I just fix all external url with JavaScript. In first my users go to /goto/XXXXXXXXXX (like /redirect/ in your system), and then to https://anon.to/?https://example.com

In my ECM I use something like that

'use strict';

$(document).ready(function () {
    const r = new RegExp('^([a-z0-9]+:)?//');
    $('a[href]').each(function () {
        if (r.test(this.href) && (this.host !== document.location.host)) {
            this.href = '/redirect/?url=' + encodeURIComponent(this.href);
            this.target = '_blank'; // I prefer to open external link in new tab everytime
        }
    });
});

And so I just change all links in advance.

kacecfox commented 4 years ago

Thank you for your help to make Commishes even better. This ticket has been reviewed and moved to our issue tracking system.

https://phabricator.magic3w.com/T86

-The Commishes Team