破解禁止复制+禁止右键菜单

使用useCapture拦截阻止事件

当前为 2025-07-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         破解禁止复制+禁止右键菜单
// @version      1.0.0
// @description  使用useCapture拦截阻止事件
// @author       TAOTAO1919
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=feishu.cn
// @grant        none
// @license      MIT
// @namespace https://greasyfork.org/users/1495458
// ==/UserScript==

(function () {
  "use strict";

  const block = e => e.stopImmediatePropagation();
  ['copy', 'cut', 'keydown', 'contextmenu'].forEach(ev => {
    document.addEventListener(ev, block, true);
    document.body.addEventListener(ev, block, true);
    window.addEventListener(ev, block, true);
  });
})();