Skip to content

Instantly share code, notes, and snippets.

@foriequal0
Created September 8, 2025 06:39
Show Gist options
  • Save foriequal0/911342baeea37055df9a546e4e38a6a8 to your computer and use it in GitHub Desktop.
Save foriequal0/911342baeea37055df9a546e4e38a6a8 to your computer and use it in GitHub Desktop.
No Turbo on GitHub
// ==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