您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add clipboard feature to simple copy infos of current page
当前为
// ==UserScript== // @name MelonBooks_Enhanced // @namespace yrMelonBooks // @version 1.0 // @description Add clipboard feature to simple copy infos of current page // @author Yanagiragi // @match https://www.melonbooks.co.jp/detail/detail.php?product_id=* // @grant GM_setClipboard // ==/UserScript== (function() { 'use strict'; // https://stackoverflow.com/a/5877034 if (window.top != window.self) //-- Don't run on frames or iframes return let nodeDiv = document.createElement("div") nodeDiv.style['padding-bottom'] = '10px' let nodeBtn = document.createElement("button") nodeBtn.addEventListener('click', event => { let title = document.querySelector('.clearfix h1') let circle = document.querySelector('.clearfix .circle') if(title && circle) GM_setClipboard (`${circle.innerHTML} - ${title.innerHTML}\n${location.href}\n`) }) let nodeText = document.createTextNode("Copy To Clipboard") document.getElementsByClassName('head')[0].prepend(nodeDiv) nodeDiv.appendChild(nodeBtn) nodeBtn.appendChild(nodeText) })();