您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove context menu and set userSelect to 'text'
当前为
// ==UserScript== // @name NTV Context Menu and Selection Change Remover // @namespace http://tampermonkey.net/ // @version 1.0 // @description Remove context menu and set userSelect to 'text' // @author Iso // @match https://*.ntv.co.jp/* // @grant none // @run-at document-body // @license MIT // ==/UserScript== /** * Override the default oncontextmenu event on the document * to disable the context menu completely. */ Object.defineProperty(document, 'oncontextmenu', { get: function () { return null }, // Return null to indicate no context menu set: function() {} // Ignore any attempts to set the context menu }); /** * Set user-select property on the document body to 'text' * to allow text selection. * This function runs when the document body loads. */ document.body.onload = (function() { 'use strict'; // Enable strict mode for cleaner code // Initialize the body style object document.body.style = {}; // Set the user-select CSS property to 'text', allowing users to select text document.body.style.userSelect = 'text'; })();