禁止写入剪贴板

禁用写入剪贴板功能,防治牛皮藓。

  1. // ==UserScript==
  2. // @name Block Clipboard Writing
  3. // @name:zh-CN 禁止写入剪贴板
  4. // @description Disable clipboard writing function to prevent moss.
  5. // @description:zh-CN 禁用写入剪贴板功能,防治牛皮藓。
  6. // @namespace https://greasyfork.org/users/197529
  7. // @version 0.0.1
  8. // @author kkocdko
  9. // @license Unlicense
  10. // @match *://*/*
  11. // @run-at document-start
  12. // ==/UserScript==
  13. "use strict";
  14.  
  15. // Pay attention to the order! Based on compatibility.
  16. document.execCommand = () => {};
  17. navigator.clipboard.writeText = () => {};
  18. navigator.clipboard.write = () => {};