IE7/8 - Twitter Intents + 'tweet' event binding overwrites parent page title if the URL includes a hash


#1

In IE7 and IE8, If the parent page URL includes a fragment identifier, and a function is bound a a callback to the tweet event, the title of the parent page is overwritten with the fragment identifier. (e.g. http://www.example.com/test#foo becomes #foo)

Reproducible in IE7 and IE8 (also works in IE9 if the browser mode is set to IE7/8)

Setup:

// standard asynchronous widgets.js load
window.twttr = (function (d,s,id) {
    var t, js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
    js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
    return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));

twttr.ready(function(twttr){
    twttr.events.bind("tweet", function(){
        // nothing needed here to reproduce the issue
    });
});

HTML:
Click this first to set a fragment in the URL. Or type one manually.
Tweet via intent


In IE7 and IE8, if you click the links in order, the page title will be set to #mylink.

#2

Thanks for this report, I’ll forward it on to the team.


#3

#4