Last active
March 28, 2024 11:59
-
-
Save NO-ob/fb37faaef9b3f2153a8daefb6bc4d760 to your computer and use it in GitHub Desktop.
This file contains 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"); | |
} | |
}); | |
}); | |
} | |
} |
Hi. I tried to add some more "bad words", but its not working. Why?
Hi the script might be broken i'll take a look
Hi. I tried to add some more "bad words", but its not working. Why?
Just updated the script try the new version
Thank you!
Thank you!
How did you find the script btw? I thought i posted on nexus forum but logged into my account and didn't see any posts there lol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I tried to add some more "bad words", but its not working. Why?