This file contains hidden or 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
| // prevent the browser on x.com for ever enabling the "For you" tab | |
| function fixYou() { | |
| if(document.querySelectorAll('[aria-selected="true"] div div span')[0].textContent == "For you"){ | |
| document.querySelectorAll('[href="/home"][aria-selected="false"]')[0].click() | |
| } | |
| } | |
| const observer = new MutationObserver((mutations) => { fixYou() }); | |
| observer.observe(document.body, { childList: true, subtree: true }); |
This file contains hidden or 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
| (function() { | |
| // fixYou disables the "For Your" button | |
| // Occassionally it has gotten into a state where for you can be renabled. | |
| function fixYou() { | |
| let defaultMatch = "For you"; | |
| let firstSelected = document.querySelectorAll('[href="/home"][aria-selected="true"]')[0]; | |
| let text = firstSelected.textContent; | |
| if(text == defaultMatch){ | |
| document.querySelectorAll('[href="/home"][aria-selected="false"]')[0].click(); |
OlderNewer