Skip to content

Instantly share code, notes, and snippets.

@bookest
Last active March 11, 2026 01:21
Show Gist options
  • Select an option

  • Save bookest/c94d6c15b2dd000eb8e81dea8bef590d to your computer and use it in GitHub Desktop.

Select an option

Save bookest/c94d6c15b2dd000eb8e81dea8bef590d to your computer and use it in GitHub Desktop.
Remove animations from newamerica.org
// ==UserScript==
// @name Remove New America Animation
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Force-removes the anim1 canvas and its containers on newamerica.org
// @author You
// @match https://newamerica.org/*
// @match https://www.newamerica.org/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// 1. Inject CSS immediately (even before the body loads)
const style = document.createElement('style');
style.innerHTML = `
canvas.anims1,
.na-animation-container,
[class*="na-animation"],
#main-nav-canvas {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
pointer-events: none !important;
height: 0 !important;
}
`;
document.head ? document.head.appendChild(style) : document.documentElement.appendChild(style);
// 2. Function to find and rip out the elements
const nuke = () => {
const elements = document.querySelectorAll('canvas.anim1, .na-animation-container, #main-nav-canvas');
elements.forEach(el => el.remove());
};
// 3. Set up a "Watcher" (MutationObserver)
// This handles cases where React/JavaScript adds the canvas LATER
const observer = new MutationObserver((mutations) => {
nuke();
});
// Start watching the entire document for changes
observer.observe(document.documentElement, {
childList: true,
subtree: true
});
// Initial run
nuke();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment