// ==UserScript== // @name 考古加助手 // @namespace https://greasyfork.org/zh-CN/scripts/481619-考古加助手 // @version 1.1 // @license GPL-3.0 // @description 增强考古加能力 // @author wzhjm // @match https://*.kaogujia.com/* // @icon https://raw.githubusercontent.com/wzhjm/MWeb_Image/main/202312072020007.ico // @grant none // @downloadURL none // ==/UserScript== (function () { 'use strict'; var t, s, a, n; t = document.createElement("script");; t.src = "https://zeptojs.com/zepto.min.js" document.body.appendChild(t); s = document.createElement("script"); s.src = "https://www.itxst.com/package/clipboardjs/clipboard.min.js" document.body.appendChild(s); var new_element = document.createElement('link'); new_element.setAttribute('rel', 'stylesheet'); //注:这里currentScript的写法不兼容IE new_element.setAttribute('href', 'https://unpkg.com/element-ui/lib/theme-chalk/index.css'); document.body.appendChild(new_element); var copyTxt=function(text){ if(typeof document.execCommand!=="function"){ alert("复制失败,请长按复制"); return; } var dom = document.createElement("textarea"); dom.value = text; dom.setAttribute('style', 'display: block;width: 1px;height: 1px;'); document.body.appendChild(dom); dom.select(); var result = document.execCommand('copy'); document.body.removeChild(dom); if (result) { alert("复制成功"); return; } if(typeof document.createRange!=="function"){ alert("复制失败,请长按复制"); return; } var range = document.createRange(); var div=document.createElement('div'); div.innerHTML=text; div.setAttribute('style', 'height: 1px;fontSize: 1px;overflow: hidden;'); document.body.appendChild(div); range.selectNode(div); const selection = window.getSelection(); if (selection.rangeCount > 0){ selection.removeAllRanges(); } selection.addRange(range); document.execCommand('copy'); alert("复制成功") } var videoListFunction = function () { // 等待zepto加载完,再执行 if ($('.pc-icon-player') && $('.pc-icon-player').forEach) { $('body').append(''); new ClipboardJS('#urlClipboard'); //全局变量 var originOpen = window.open; var copyOpen = function (url) { //将链接转化成原视频链接 url = url.replaceAll('\/share', '').replaceAll('?', ''); $('#urlClipboard').data('clipboard-text', url); $('#urlClipboard').click(); console.log("已复制:" + url); } $('body').on('click', '.check-item', function () { if ($(this).hasClass('el-icon-check')) { $(this).removeClass('el-icon-check') } else { $(this).addClass('el-icon-check') } changeSelect() }) //添加浮动的选择按钮 $('body').append(`