// ==UserScript== // @name Ferium add command for modrinth // @namespace Violentmonkey Scripts // @match https://modrinth.com/mods // @license MIT // @grant none // @version 0.1.1 // @author - // @description 2022/6/6 19:57:03 // @downloadURL none // ==/UserScript== const observer = new MutationObserver((mutations, observer) => { for(const mutation of mutations) { if (mutation.type === 'childList' && mutation.target.id === 'search-results') { for(const node of mutation.addedNodes) { const buttons = node.querySelector('.right-side .buttons') if(node.className === 'project-card card' && !buttons.querySelector('button[title^="ferium"]')) { const title = node.querySelector('.title a').href.match(/.*\/(.*)/)[1] buttons.innerHTML += `` } } } } }); observer.observe(document.body, { attributes: false, childList: true, subtree: true });