您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2022/6/6 19:57:03
当前为
- // ==UserScript==
- // @name Ferium add command for modrinth
- // @namespace Violentmonkey Scripts
- // @match https://modrinth.com/mods
- // @license MIT
- // @grant none
- // @version 0.1.0
- // @author -
- // @description 2022/6/6 19:57:03
- // ==/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) {
- if(node.className === 'project-card card') {
- const buttons = node.querySelector('.right-side .buttons')
- const title = node.querySelector('.title a').href.match(/.*\/(.*)/)[1]
- buttons.innerHTML += `<button class="iconified-button" onclick='navigator.clipboard.writeText("ferium add ${title}");this.innerText="Copied!"' title="ferium add ${title}">Ferium</button>`
- }
- }
- }
- }
- });
- observer.observe(document.body, { attributes: false, childList: true, subtree: true });