Skip to content

Instantly share code, notes, and snippets.

@Soochaehwa
Created September 11, 2023 16:02
Show Gist options
  • Save Soochaehwa/69c7646970e90928d0873ff845aa588c to your computer and use it in GitHub Desktop.
Save Soochaehwa/69c7646970e90928d0873ff845aa588c to your computer and use it in GitHub Desktop.
Delete the mods that use data packs from the Modrinth mod list
// ==UserScript==
// @name Fuck Datapack
// @version 0.1.0
// @namespace https://github.com/Soochaehwa
// @description Delete the mods that use data packs from the Modrinth mod list
// @match https://modrinth.com/mods*
// @license MIT
// ==/UserScript==
(function () {
"use strict";
const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === "childList") {
const categories = document.querySelectorAll("div.categories");
categories.forEach(function (category) {
const hasDataPack = Array.from(category.childNodes).some(function (child) {
return child.textContent === "Data Pack";
});
if (hasDataPack) {
category.parentNode.remove();
}
});
}
});
});
const target = document.body;
const config = { childList: true, subtree: true };
observer.observe(target, config);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment