Skip to content

Instantly share code, notes, and snippets.

@superskirv
Last active June 23, 2025 03:19
Show Gist options
  • Save superskirv/b2f3be9d9ed5b8ede8b3b698e9e9ca10 to your computer and use it in GitHub Desktop.
Save superskirv/b2f3be9d9ed5b8ede8b3b698e9e9ca10 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Civitai Ad Div Remover
// @namespace https://civitai.com/user/superskirv
// @version 0.5
// @description Removes add cell from the front page, and possibly others.
// @author Super.Skirv and Qwen2.5-Coder-32B-Instruct
// @match https://civitai.com/*
// @icon https://civitai.com/images/android-chrome-192x192.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
function removeAdDiv() {
const targetClass = "relative flex overflow-hidden rounded-md border-gray-3 bg-gray-0 shadow-gray-4 dark:border-dark-4 dark:bg-dark-6 dark:shadow-dark-8 flex-col mx-auto min-w-80 justify-between gap-2 border p-2 shadow";
document.querySelectorAll('div').forEach(div => {
if (div.className === targetClass) {
div.remove();
}
});
}
// Run once on load and periodically in case new content loads dynamically
window.addEventListener('load', removeAdDiv);
setInterval(removeAdDiv, 2000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment