您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent websites from entirely disable web browser's Right-Click context menu by allowing use of SHIFT+RightClick, CTRL+RightClick, or CTRL+SHIFT+RightClick (configurable in the script code). This script is designed for Chrome and Chromium based web browsers. Firefox already has this feature built in via SHIFT+RightClick.
- // ==UserScript==
- // @name Prevent Right-Click Context Menu Hijaak
- // @namespace https://greasyfork.org/en/users/85671-jcunews
- // @version 1.0.2
- // @license AGPLv3
- // @author jcunews
- // @description Prevent websites from entirely disable web browser's Right-Click context menu by allowing use of SHIFT+RightClick, CTRL+RightClick, or CTRL+SHIFT+RightClick (configurable in the script code). This script is designed for Chrome and Chromium based web browsers. Firefox already has this feature built in via SHIFT+RightClick.
- // @match *://*/*
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- (() => {
- //=== CONFIGURATION BEGIN ===
- //At least either SHIFT or CTRL should be set to true.
- let useShift = true;
- let useCtrl = false;
- //=== CONFIGURATION END ===
- let epd = Event.prototype.preventDefault;
- Event.prototype.preventDefault = function() {
- if (this.type === "contextmenu") {
- if (((useShift && this.shiftKey) && (useCtrl && this.ctrlKey)) || (useShift && this.shiftKey) || (useCtrl && this.ctrlKey)) return;
- }
- return epd.apply(this, arguments);
- };
- })();