Created
January 22, 2023 21:28
-
-
Save f/ed5a574ef17768b740b017d650098739 to your computer and use it in GitHub Desktop.
Twitter Arc Boost
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
const $$ = document.querySelectorAll.bind(document); | |
const $ = document.querySelector.bind(document); | |
const watchBody = new MutationObserver(() => { | |
const tabs = `[href='/home'][role='tab']`; | |
const homeButton = `[aria-label="Home"]`; | |
const $tabs = $$(tabs); | |
if ($tabs?.length > 1) { | |
$tabs[1]?.click(); | |
$(homeButton).addEventListener('click', () => { | |
setTimeout(() => $$(tabs)?.[1].click()); | |
}) | |
watchBody.disconnect(); | |
} | |
}); | |
watchBody.observe(document.body, { | |
childList: true, | |
subtree: true, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment