Last active
January 15, 2025 07:39
-
-
Save VirusRushTheater/90a8d7f045cabcc77660b0f6e329a324 to your computer and use it in GitHub Desktop.
Tampermonkey script to remove Twitter login popups
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 Twitter login popup remover | |
// @namespace http://github.com/VirusRushTheater | |
// @version 0.1 | |
// @description No, I don't wanna register on Twitter | |
// @author VirusRushTheater | |
// @match https://twitter.com/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function getLoginScreen() | |
{ | |
var presence = true; | |
// Group DIV with no ID | |
var block = Array.from(document.querySelectorAll("div [role=group]")).filter((x_i)=>(x_i.id === ""))[0]; | |
if (block === undefined) | |
return null; | |
if (block.querySelectorAll("svg").length > 2) | |
return null; | |
else | |
return block; | |
} | |
// Remove the layout and allow scrolling again. Check every 250 seconds. | |
setInterval(() => { | |
var block = getLoginScreen(); | |
if (block !== null) | |
{ | |
console.log("Popup removed"); | |
block.remove(); | |
document.querySelector("html").style["overflow"] = "inherit"; | |
} | |
}, 250); | |
// Your code here... | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment