Last active
June 9, 2023 13:14
-
-
Save kriogenia/85af9a9e539e26e28b3ad9aec5b9f6db to your computer and use it in GitHub Desktop.
Removes the Verified links in the Nav and Aside from Twitter
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 Remove Verification Nav and Aside | |
// @namespace http://www.sotoestevez.dev/ | |
// @version 0.2 | |
// @description removes the verification aside from twitter | |
// @author sotoestevez | |
// @match https://*twitter.com/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// @downloadUrl https://gist.github.com/kriogenia/85af9a9e539e26e28b3ad9aec5b9f6db | |
// @uploadUrl https://gist.github.com/kriogenia/85af9a9e539e26e28b3ad9aec5b9f6db | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// this one is being injected constantly | |
const removeAside = () => { | |
const [aside] = [...document.querySelectorAll("[href='/i/verified-choose']")]; | |
aside?.parentElement.parentElement.remove(); | |
}; | |
const removeVerified = () => { | |
const [nav, aside] = [...document.querySelectorAll("[href='/i/verified-choose']")]; | |
if (nav && aside) { | |
nav.remove(); | |
aside.parentElement.parentElement.remove(); | |
new MutationObserver((mutationList, observer) => removeAside()).observe(document.querySelector("main"), { childList: true, subtree: true }); | |
} else { | |
setTimeout(removeVerified, 250); | |
} | |
}; | |
removeVerified(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment