Created
September 8, 2025 06:39
-
-
Save foriequal0/911342baeea37055df9a546e4e38a6a8 to your computer and use it in GitHub Desktop.
No Turbo on GitHub
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
| // ==UserScript== | |
| // @name No turbo on GitHub | |
| // @match https://github.com/* | |
| // @grant none | |
| // @version 1.0 | |
| // @author SeongChan Lee <[email protected]> | |
| // @run-at document-start | |
| // ==/UserScript== | |
| async function waitFor(root, selector) { | |
| return new Promise(resolve => { | |
| const target = selector(root); | |
| if (target) { | |
| resolve(target); | |
| return; | |
| } | |
| const observer = new MutationObserver(() => { | |
| const target = selector(root); | |
| if (target) { | |
| observer.disconnect(); | |
| resolve(target); | |
| return; | |
| } | |
| }); | |
| observer.observe(document, { | |
| attributes: true, | |
| subtree: true, | |
| childList: true, | |
| }); | |
| }) | |
| } | |
| async function main() { | |
| const target = await waitFor(document, (document) => document.documentElement); // <html> | |
| function disable() { | |
| target.setAttribute("data-turbo", "false"); | |
| } | |
| disable(); | |
| const observer = new MutationObserver(() => { | |
| disable(); | |
| }); | |
| observer.observe(target, { | |
| attributes: true, | |
| attributeFilter: "data-turbo", | |
| }); | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment