Skip to content

Instantly share code, notes, and snippets.

@jweir
Created August 5, 2025 17:26
Show Gist options
  • Save jweir/a84b5a9a117603efde879dd08cd1f9b3 to your computer and use it in GitHub Desktop.
Save jweir/a84b5a9a117603efde879dd08cd1f9b3 to your computer and use it in GitHub Desktop.
(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