From 71e34092cd24e524525db14029388645ffb722a6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 1 Jun 2023 19:43:41 +0200 Subject: [PATCH] exclude cards --- twitter.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter.user.js b/twitter.user.js index 08a6830..eae2b06 100644 --- a/twitter.user.js +++ b/twitter.user.js @@ -4,7 +4,7 @@ // ==/UserScript== function mkurl(txt){if(!/^http/.test(txt)){txt = "https://"+txt}txt = txt.replace(/…$/, "");return txt;} -function repllnks(lnks){for(let lnk of lnks){lnk.href = mkurl(lnk.textContent);lnk.classList.add("unshortreplaced");}} +function repllnks(lnks){for(let lnk of lnks){if(!lnk.querySelector("div"))lnk.href = mkurl(lnk.textContent);lnk.classList.add("unshortreplaced");}} function getlnks(){return document.querySelectorAll("a[href^='https://t.co']:not(.unshortreplaced)");} function replrun(){repllnks(getlnks());} replrun();