public
Created

tco no

  • Download Gist
tco no
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
document.addEventListener("mouseover", function(e) {
var t=e.target, u;
if(!t.href) t = t.parentNode;
if(t.href) {
if(t.host=="t.co"){
u=t.getAttribute("data-expanded-url");
if(!u && t.search) {
u=(u=t.search.match(/\burl=(.+)?&/))&&unescape(u[1]);
} else if(!u && t.title.indexOf("http") == 0) {
u = t.title;
}
if(u) t.href=u;
}
}
}, false);
 
/* Tersely compiled for bookmarklet use:
javascript:document.addEventListener("mouseover",function(a){var a=a.target,b;a.href||(a=a.parentNode);if(a.href&&"t.co"==a.host&&(b=a.getAttribute("data-expanded-url"),!b&&a.search?b=(b=a.search.match(/\burl=(.+)?&/))&&unescape(b[1]):!b&&0==a.title.indexOf("http")&&(b=a.title),b))a.href=b},!1);
*/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.