您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
左键选中
// ==UserScript== // @name 左键限制解除 // @description 左键选中 // @version 1.3 // @match *://*/* // @run-at document-start // @grant none // @namespace http://greasyfork.icu/users/12375 // ==/UserScript== (function() { // 默认规则配置 var rule = { hook_addEventListener: true, }; // 初始化 function init() { // hook addEventListener if(rule.hook_addEventListener) { document.addEventListener = addEventListener; } } init(); // 视频控制保护逻辑 const EV = { select: 1, selectstart: 2, copy: 4, cut: 8, contextmenu: 16, mousedown: 32, mouseup: 64, mousemove: 128, click: 256 }; const isVideoControl = (target) => { if(target.tagName === 'VIDEO' || target.classList.contains('progress-bar') || target.closest('video,[role^="video-"]')) { return true; } return false; }; const { addEventListener: protoAdd } = EventTarget.prototype; EventTarget.prototype.addEventListener = function(type, listener, options) { const eventFlag = EV[type] || 0; if(eventFlag & 0b00011111 && !isVideoControl(this)) {} else { protoAdd.call(this, type, listener, options); } }; })();