您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to copy known words to clipboard
// ==UserScript== // @name Copy known words from kitsun.io // @namespace Violentmonkey Scripts // @match https://kitsun.io/* // @grant none // @version 0.3 // @author bspar // @license MIT; http://opensource.org/licenses/MIT // @description Adds a button to copy known words to clipboard // @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2 // ==/UserScript== var allKnown = ''; var allItems = []; function clipList(wordListDiv) { allItems.forEach((item) => { allKnown += item + '\n'; }); // japanese parens allKnown = allKnown.replace(/[()]/g, ''); // console.log(allKnown); navigator.clipboard.writeText(allKnown); } // https://stackoverflow.com/a/29293383 (function(open) { XMLHttpRequest.prototype.open = function() { this.addEventListener('readystatechange', function() { if(this.readyState === 4) { if(this.responseURL.includes('https://api.kitsun.io/wordlists?category=')) { var obj = JSON.parse(this.responseText); allItems = obj.words; } } }, false); open.apply(this, arguments); }; })(XMLHttpRequest.prototype.open); // wait for the document to load const disconnect = VM.observe(document.body, () => { // Find the table const node = document.querySelector('.word-list'); // find the header if(node) { const headerDiv = node.querySelector('.kitTableHeader'); if(headerDiv) { const exportBtn = document.createElement('div'); exportBtn.classList.add('th'); exportBtn.textContent = 'Copy to clipboard'; exportBtn.addEventListener('click', clipList); headerDiv.appendChild(exportBtn); return true; } } });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址