Last active
March 25, 2025 13:31
-
-
Save NO-ob/fb37faaef9b3f2153a8daefb6bc4d760 to your computer and use it in GitHub Desktop.
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 sanitizeNexus | |
// @icon https://www.nexusmods.com/favicon.ico | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Removes unwanted trash from nexus mods | |
// @author kannalo | |
// @match https://www.nexusmods.com/* | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
var badCat = ["Characters"]; | |
var badWords = ["reshade","shader","savegame","save game","savegames","save games","preset","presets","savefile","savefiles","save file","saved file","save files","starting save","starting saves","starter save","starter saves","fresh start","mode plus","save location"]; | |
(function() { | |
let modList = document.getElementById("mod-list"); | |
if (modList){ | |
(new MutationObserver(checkCategories)).observe(document, {childList: true, subtree: true}); | |
} | |
})(); | |
function checkCategories(){ | |
let tiles = document.querySelectorAll("ul.tiles > li.mod-tile"); | |
if (tiles){ | |
tiles.forEach( tile => { | |
badCat.forEach( bad => { | |
let categories = tile.querySelectorAll("div.category > a"); | |
for(let i = 0; i < categories.length; i++){ | |
if(categories[i].innerHTML.toLowerCase() === bad.toLowerCase()){ | |
tile.remove(); | |
console.log("killed"); | |
break; | |
} | |
} | |
}); | |
}); | |
} | |
checkWords(); | |
} | |
function checkWords(){ | |
let tiles = document.querySelectorAll("ul.tiles > li.mod-tile"); | |
if (tiles){ | |
tiles.forEach( tile => { | |
badWords.forEach( bad => { | |
if (tile.querySelector("p.tile-name").innerHTML.toLowerCase().includes(bad.toLowerCase())){ | |
tile.remove(); | |
console.log("killed"); | |
} else if (tile.querySelector("p.desc").innerHTML.toLowerCase().includes(bad.toLowerCase())){ | |
tile.remove(); | |
console.log("killed"); | |
} | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was searching scripts for nexus in tempermonkey search, and there found your script.