Comment 8 for bug 1275855

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

The google plus HTML5 application installs a custom onclick handler for this kind of links, which does this:

    function onclick(event) {
        navIfNotButton(event, '\/app\/basic\/stream\/z13wiz1hgyejzbfm422yehzicpicjf3w204?cbp\x3d1s0i1p8k5a3o4\x26sview\x3d27\x26cid\x3d5\x26soc-app\x3d115\x26soc-platform\x3d1\x26spath\x3d\/app\/basic\/%2Bomgubuntu\/posts\x26sparm\x3dcbp%3Dy9lgk6woanfp%26sview%3D28%26cid%3D5%26soc-app%3D115%26soc-platform%3D1%26spath%3D\/app\/basic\/s%26sparm%3Dsc%253Dpp%2526sq%253Domg%252Bubuntu');
    }

And the navIfNotButton function does this:

    function navIfNotButton(event, dest) {
        var n = event.toElement;
        for (var i = 0; i < 4; i++) {
            if (!n) {
                break;
            }
            if (n.nodeName == 'A' || n.nodeName == 'BUTTON') {
                return;
            }
            n = n.parentElement;
        }
        window.location.href = dest;
    }

The element being clicked is a hyperlink (nodeName == 'A'), so this navIfNotButton function just ignores the click event, for some reason that escapes me.