Created
August 5, 2025 17:26
-
-
Save jweir/a84b5a9a117603efde879dd08cd1f9b3 to your computer and use it in GitHub Desktop.
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(); | |
} | |
} | |
const observer = new MutationObserver((mutations) => { fixYou(); }); | |
observer.observe(document.body, { childList: true, subtree: true }); | |
window.addEventListener('load', () => { fixYou(); }); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment