您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
优化CoCo!可自动保存、一键静默发布...
当前为
// ==UserScript== // @name 优化CoCo // @namespace https://shequ.codemao.cn/user/6384716 // @version 1.1.2 // @description 优化CoCo!可自动保存、一键静默发布... // @author XJ王大哥(QQ2357942846) // @match *://coco.codemao.cn/editor/?workId=* // @icon https://static.codemao.cn/coco/player/unstable/rJenQZM03.image/png?hash=FvJjSLkZJwhh6XMquWvTB6MqxL // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict' let inquiry let href = new URL(location.href) const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) // 新建设置按钮 document.querySelector(".Header_saveBtn__IhQCn").insertAdjacentHTML('afterend','<button class="coco-button coco-button-circle Header_saveBtn__IhQCn" id="CoCo优化_自动"><span class="Header_saveText__31lXM">自动</span><span class="Header_savingIcon__30nr4"><svg class="Spinner_spinner__1Nh-g" viewBox="0 0 50 50"><circle class="Spinner_spinnerPath__2LlP3" cx="25" cy="25" r="20" fill="none" stroke-width="6" stroke="#6e4ff4"></circle></svg></span></button>') document.getElementById('CoCo优化_自动').addEventListener('click',() => { inquiry = prompt('修改自动保存间隔(s):',GM_getValue('interval') / 1000) if (inquiry) { GM_setValue('interval', +inquiry * 1000) } }) // 新建发布按钮 document.querySelector(".Header_saveBtn__IhQCn").insertAdjacentHTML('afterend','<button class="coco-button coco-button-circle Header_saveBtn__IhQCn" id="CoCo优化_发布"><span class="Header_saveText__31lXM">发布</span><span class="Header_savingIcon__30nr4"><svg class="Spinner_spinner__1Nh-g" viewBox="0 0 50 50"><circle class="Spinner_spinnerPath__2LlP3" cx="25" cy="25" r="20" fill="none" stroke-width="6" stroke="#6e4ff4"></circle></svg></span></button>') document.getElementById('CoCo优化_发布').addEventListener('click',() => { document.querySelectorAll(".style_shareBtn__2X5i-")[1].click() document.querySelector("#_cocoDialogContainer > div:nth-child(4) > div.coco-dialog-scroll > div > div.coco-dialog-title > span").click() var i = document.createElement("textarea"); i.style.position = "fixed"; i.style.top = "0"; i.style.left = "0"; i.focus(); document.body.append(i) i.value = document.querySelector("#_cocoDialogContainer > div:nth-child(4) > div.coco-dialog-scroll > div > div.coco-dialog-content > div.style_qrWrapper__1uWkX > div.style_shareLinkWrapper__1rQdk > div.style_link__3VnNA").innerText; i.select(); document.execCommand('copy', false, null) i.remove() }) // 删除提示 document.querySelector("#root > div > div.coco-alert.coco-alert-info.CommonToast_wrapper__1vp1G.hide").remove() // 获取保存按钮 const saveButton = document.querySelector("#root > div > header > div > div.Header_right__3m7KF > button:nth-child(4)") async function save(){ while(true) { await sleep(GM_getValue('interval')) saveButton.click() } } save() })();