DrudgeReport.com not respecting ctrl-click on its links

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: Natch, Unassigned)

Tracking

Firefox 30
x86_64
Windows 8.1

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [email sent 6/25/2014] [country-us] [sitewait], URL)

(Reporter)

Description

4 years ago
Drudge overwrites itself when a link is ctrl-click'ed
(Reporter)

Comment 1

4 years ago
Email sent to drudge@drudgereport.com, as follows:

Hi,

The links on the drudge report do not properly open in a new tab/window when the [ctrl] key is held down during a click. This is the default behavior for links in Firefox and is part of the user's muscle memory when using the browser.

This default is overridden by some javascript on your page. If the default must be overridden (perfectly understandable/acceptable) please add the functionality in the javascript function by detecting the pressed state of the [ctrl] key (event.ctrlKey: https://developer.mozilla.org/en-US/docs/Web/API/event.ctrlKey) and opening in a new tab/window (specify "_blank" in the second argument to window.open: https://developer.mozilla.org/en-US/docs/Web/API/Window.open).

See bug 1027891.

Thank you.
Whiteboard: [email sent 6/25/2014]

Comment 2

4 years ago
Note. on a macintosh this is command+click (as ctrl+click brings the contextual menu).

So currently the site still does it for Macintosh.
Was it fix for the windows platform? 

drudgereport_postview.js line 149 has an event.preventDefault() capturing the click.

        var anchorTagArray = document.getElementsByTagName("a");
        for (var i = 0; i < anchorTagArray.length; i++)
        {
            // Test the ignoreClass value and act accordingly
            if (ignoreClass != null && anchorTagArray[i].className == ignoreClass)
                continue;

            anchorTagArray[i].addEventListener("click",function (event) 
                {
                    event.preventDefault();
                    categorise(this);
                }, 
                false
            );
        }

The categorise(this) calls a function which is creating a var url
 
example:
http://intermarket.grapeshot.co.uk/main/drudge-jsonp.fcgi?url=http%3A%2F%2Fonline.wsj.com%2Farticles%2Falibabas-ipo-priced-at-68-a-share-1411075675%3Fmod%3DWSJ_hp_LEFTTopStories&callback=parseResponse

Then it fetches this URI and replace the view.
Assignee: english-us → nobody
Component: English US → Desktop
Whiteboard: [email sent 6/25/2014] → [email sent 6/25/2014] [country-us] [sitewait]

Comment 3

2 years ago
testing today, this seems to be fixed.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.