Created
January 29, 2012 18:58
-
-
Save GarrettS/1700145 to your computer and use it in GitHub Desktop.
UsurpTCO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: void(function(){document.addEventListener("mousedown", tcoToLinkTitleURL, true); function tcoToLinkTitleURL(ev) { var target = ev.target; if(/^http(?:s?):\/\/t.co\//.test(target.href)) target.href=target.title; } }()); |
TODO: Make a plugin for browser that us automatically activated when twitter.com is loaded, thus avoiding the need for the user to remember to activate bookmarklet. E.g. instead of:
- visit twitter.com
- click bookmarklet
With an add-on, it would be just
- visit twitter.com
Added (?:s?)
to regexp for https.
Updated based on gist by @tagawa
document.addEventListener("mousedown",function(e){var%20t=e.target,u=t.getAttribute("data-expanded-url");if(t.host=="t.co"&&u)t.href=u;},true);
UPDATE: https://gist.github.com/2969301
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Benefits:
Avoids tracking/spying, improves performance, avoids t.co downage problems.