diff --git a/.js/com/twitter.js b/.js/com/twitter.js new file mode 100644 index 0000000..6ba5435 --- /dev/null +++ b/.js/com/twitter.js @@ -0,0 +1,20 @@ +// go directly to links, bypassing t.co +(function() { + $("a[data-expanded-url]").each((i, el) => { + el = $(el); + el.attr("href", el.attr("data-expanded-url")); + }); + $("ol.stream-items").each((i, list) => { + let observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((it) => { + $(it).find("a[data-expanded-url]").each((i, el) => { + el = $(el); + el.attr("href", el.attr("data-expanded-url")); + }); + }); + }); + }); + observer.observe(list, { childList: true }); + }) +})(); \ No newline at end of file diff --git a/.js/com/twitter/tweetdeck.js b/.js/com/twitter/tweetdeck.js new file mode 100644 index 0000000..a300eeb --- /dev/null +++ b/.js/com/twitter/tweetdeck.js @@ -0,0 +1,21 @@ +// go directly to links, bypassing t.co +(function() { + $("a[data-full-url]").each((i, el) => { + el = $(el); + el.attr("href", el.attr("data-full-url")); + }); + + $(".js-chirp-container").each((i, container) => { + let observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((it) => { + $(it).find("a[data-full-url]").each((i, el) => { + el = $(el); + el.attr("href", el.attr("data-full-url")); + }); + }); + }); + }); + observer.observe(container, { childList: true }); + }); +})(); \ No newline at end of file