Closed ansell closed 10 years ago
One have jQuery dependency.
And it's pretty much the same behavior. t.co is evil gets all links by Twitter with the twitter-time-link
class and this one goes through all the links in the page with href
matching //t.co
.
Though, thinking about it. t.co is evil will only catch links in the timeline, I don't know if there are t.co
links in some modals or in the interface.
<a href="http://t.co/nTIbRSv9aW" data-expanded-url="http://ift.tt/1nPR4Fq" class="twitter-timeline-link" [...]>[...]</a>
Then both replace the href
with the data in data-expanded-url
and sets an event listener on the DOM, so if the DOM changed with auto-load or something else, we re-run the script to update the new t.co
links.
this repo no longer relies on jquery unless you're using safari, just an fyi
Also, it is now using a MutationObserver instead of DOM node events. They tend to be very noisy and fire quite often. It should be far more efficient now, updating an order of magnitude less often.
Things change fast around here :satisfied: So if I anwsered correctly OP's question, we could close this issue! :wink:
Yes, that was a good explanation. The MutationObserver looks cleaner than the fixLinks(document) method. :+1:
I have been using t.co is the devil greasemonkey script, successfully, to do this. However, it appears to use a completely different method, which still appears to work with the current interface. What are the significant differences between the method used here and that?
Script was originally from https://userscripts.org/scripts/show/115929 , and is reproduced below: