子龙 子龙
首页
学习指南
工具
AI副业
开源项目
技术书籍

程序员子龙

Java 开发从业者
首页
学习指南
工具
AI副业
开源项目
技术书籍
  • 工具
  • 开发工具

  • office

  • 实用工具

    • 阿里云盘分享压缩包方法
    • 网页内容不能复制,有了这个工具,爽爆了
    • 解除知识星球复制限制
  • 工具
  • 实用工具
程序员子龙
2024-04-17

解除知识星球复制限制

// ==UserScript==
// @name         解除知识星球复制限制(解决知识星球不能复制文本)
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Ctrl+C
// @author       zqx
// @match        https://*.zsxq.com/*
// @icon         https://www.google.com/s2/favicons?domain=zsxq.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // https://github.com/CoeJoder/waitForKeyElements.js
    function waitForKeyElements(selectorOrFunction, callback, waitOnce, interval, maxIntervals) {
        if (typeof waitOnce === "undefined") {
            waitOnce = true;
        }
        if (typeof interval === "undefined") {
            interval = 300;
        }
        if (typeof maxIntervals === "undefined") {
            maxIntervals = -1;
        }
        var targetNodes = (typeof selectorOrFunction === "function")
        ? selectorOrFunction()
        : document.querySelectorAll(selectorOrFunction);

        var targetsFound = targetNodes && targetNodes.length > 0;
        if (targetsFound) {
            targetNodes.forEach(function(targetNode) {
                var attrAlreadyFound = "data-userscript-alreadyFound";
                var alreadyFound = targetNode.getAttribute(attrAlreadyFound) || false;
                if (!alreadyFound) {
                    var cancelFound = callback(targetNode);
                    if (cancelFound) {
                        targetsFound = false;
                    }
                    else {
                        targetNode.setAttribute(attrAlreadyFound, true);
                    }
                }
            });
        }

        if (maxIntervals !== 0 && !(targetsFound && waitOnce)) {
            maxIntervals -= 1;
            setTimeout(function() {
                waitForKeyElements(selectorOrFunction, callback, waitOnce, interval, maxIntervals);
            }, interval);
        }
    }

    waitForKeyElements(".disabled-copy", (element) => {
        element.classList.remove("disabled-copy");
    }, false, 1000, 86400);
    waitForKeyElements("[watermark]", (element) => {
        element.setAttribute("style", "padding: 10px;");
    }, false, 1000, 86400);
    waitForKeyElements(".js-disable-copy", (element) => {
        element.setAttribute("class", "");
    }, false, 1000, 86400);
})();

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
上次更新: 2024/04/28, 07:59:12
网页内容不能复制,有了这个工具,爽爆了

← 网页内容不能复制,有了这个工具,爽爆了

最近更新
01
保姆级教程 用DeepSeek+飞书,批量写文案、写文章,太高效了
06-06
02
还在为整理视频思维导图发愁?2 种超实用技巧,让你 10 分钟搞定,高效又省心!
06-06
03
熬夜做PPT?AI一键生成高逼格幻灯片,效率提升10倍!
06-06
更多文章>
Theme by Vdoing | Copyright © 2024-2025

    辽ICP备2023001503号-2

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式