您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
王者荣耀台词网站生成台词文本,方便查看和下载。
当前为
// ==UserScript== // @name 王者荣耀生成台词文本 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 王者荣耀台词网站生成台词文本,方便查看和下载。 // @author You // @match https://world.honorofkings.com/* // @match https://pvp.qq.com/ip/* // @icon https://www.google.com/s2/favicons?sz=64&domain=honorofkings.com // @grant none // @license GPL-3.0-or-later // ==/UserScript== (function() { 'use strict'; function generateQuotesText() { const voiceItems = document.querySelectorAll('.dinfo-voice-item'); let quotesText = ''; voiceItems.forEach((voiceItem, index) => { const speechText = voiceItem.querySelector('span').textContent.trim(); quotesText += `${index + 1}. ${speechText}\n`; }); // 创建文本框 const textArea = document.createElement('textarea'); textArea.value = quotesText; textArea.style.width = '100%'; textArea.style.height = '200px'; textArea.readOnly = true; // 创建下载按钮 const downloadButton = document.createElement('button'); downloadButton.textContent = 'Download Quotes Text'; downloadButton.style.marginTop = '10px'; downloadButton.addEventListener('click', () => { const blob = new Blob([quotesText], { type: 'text/plain' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = 'quotes.txt'; link.click(); }); // 将文本框和按钮添加到页面 const container = document.createElement('div'); container.appendChild(textArea); container.appendChild(downloadButton); // 将容器添加到页面 document.body.appendChild(container); } // 创建一键生成和下载按钮 const generateAndDownloadButton = document.createElement('button'); generateAndDownloadButton.textContent = '在网站底部生成台词文本'; generateAndDownloadButton.style.position = 'fixed'; generateAndDownloadButton.style.top = '50px'; generateAndDownloadButton.style.left = '10px'; generateAndDownloadButton.style.zIndex = '999'; // 添加 z-index generateAndDownloadButton.addEventListener('click', generateQuotesText); // 将按钮添加到页面 document.body.appendChild(generateAndDownloadButton); })();