Comment 1 for bug 1159857

Revision history for this message
Olivier Tilloy (osomon) wrote :

As noted in bug #1129281, it looks like twitter does additional processing of hyperlinks in tweets. According to the webkit web inspector, an event listener is installed on the document (from https://platform.twitter.com/widgets.js) which does the following:

    function p(a) {
        a = a || window.event;
        var b = a.target || a.srcElement, c, d, e;
        while (b && b.nodeName.toLowerCase() !== "a") b = b.parentNode;
        b && b.nodeName.toLowerCase() === "a" && b.href && (c = b.href.match(f), c && (e = o(b.href), e = e.replace(/^http[:]/, "https:"), e = e.replace(/^\/\//, "https://"), q(e, b), a.returnValue = !1, a.preventDefault && a.preventDefault()));
    }

So, for some reason that I don’t fully understand yet, this listener cancels the event without stopping further propagation of it (see https://developer.mozilla.org/en-US/docs/DOM/event.preventDefault). I suspect this listener is what prevents the custom handler (see fix for bug #1129281) from getting the click event. Needs more investigation.