NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name 禁止中国大学mooc右键、复制弹窗 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 中国大学mooc通过alert弹窗禁止右键和复制,该脚本用于取消弹窗 // @author lsyanling // @match https://www.icourse163.org/* // @icon https://www.google.com/s2/favicons?sz=64&domain=icourse163.org // @license MIT // @copyright 2023, lsyanling (https://openuserjs.org/users/lsyanling) // ==/UserScript== (function() { 'use strict'; // Your code here... var _oncontextmenu = document.oncontextmenu; var _onkeydown = document.onkeydown; // 由于路由切换时会重置document,所以暴力点直接每秒修改一次 setInterval(()=>{ document.oncontextmenu = function() { window.event.returnValue = true; }; document.onkeydown = function(e) { e = window.event || e; if ((e.ctrlKey && e.keyCode == 67) || (e.metaKey && e.keyCode == 67)) { e.returnValue = true; } }; },1000) // var _oncontextmenu = document.oncontextmenu; // document.oncontextmenu = function() { // window.event.returnValue = true; // }; // var _onkeydown = document.onkeydown; // document.onkeydown = function(e) { // e = window.event || e; // if ((e.ctrlKey && e.keyCode == 67) || (e.metaKey && e.keyCode == 67)) { // e.returnValue = true; // } // }; // var _alert = window.alert; // window.alert = function() { // return true; // } })();