Free Copy

支持复制受限网站的文本内容

当前为 2021-03-29 提交的版本,查看 最新版本

// ==UserScript==
// @name         Free Copy
// @name:CN:zh   自由复制
// @namespace    https://github.com/GuoChen-thlg
// @version      0.1.0
// @description  支持复制受限网站的文本内容
// @author       THLG
// @supportURL   [email protected]
// @match        *://wenku.baidu.com/*
// @match        *
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function () {
    'use strict';
    function rejectOtherHandlers (e) {
        e.stopPropagation()
        if (e.stopImmediatePropagation) {
            e.stopImmediatePropagation()
        }
    }
    [
        'copy',
        'keydown',
        'keyup',
    ].forEach((event) => {
        document.documentElement.addEventListener(event, rejectOtherHandlers, {
            capture: true,
        })
    })
    var style = [
        "*::before",
        "*",
        "*::after",
    ].join(',') + "{ user-select: initial !important;\n -webkit-user-select: initial !important; }"
    var n_style = document.createElement('style')
    n_style.innerHTML = style
    document.getElementsByTagName('head')[0].appendChild(n_style)
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址