Created
October 6, 2015 05:47
-
-
Save lgp171188/9641e79700a2e9babf62 to your computer and use it in GitHub Desktop.
Auto expand t.co links on Tweetdeck website
This file contains 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
// ==UserScript== | |
// @name Auto expand t.co links on Tweetdeck website | |
// @namespace https://github.com/lgp171188 | |
// @include https://tweetdeck.twitter.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function expandTwitterShortlinks() { | |
var twitter_shortlinks = document.getElementsByClassName('url-ext'); | |
for (var i = 0; i < twitter_shortlinks.length; i++) { | |
var shortlink = twitter_shortlinks[i]; | |
if (shortlink.classList.contains('tco-url-expanded')) { | |
continue; | |
} | |
else { | |
var actual_url = shortlink.getAttribute('data-full-url'); | |
shortlink.setAttribute('href', actual_url); | |
shortlink.classList.add('tco-url-expanded'); | |
} | |
} | |
} | |
document.addEventListener('DOMNodeInserted', expandTwitterShortlinks, false); | |
expandTwitterShortlinks(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment