使用JS代码移除网页右键限制
要解除网页右键限制,可以使用以下JavaScript代码: ```javascript document.oncontextmenu = function() { return true; }; ```
JS解除右键限制方法一
javascript:(function(){functionR(a){ona="on"+a;if(window.addEventListener){window.addEventListener(a,function(e){for(varn=e.originalTarget;n;n=n.parentNode){n[ona]=null;}},true);}window[ona]=null;document[ona]=null;if(document.body){document.body[ona]=null;}}R("contextmenu");R("click");R("mousedown");R("mouseup");R("selectstart");})();
使用方法:打开网页F12 ,把代码粘贴到控制台(Console),回车即可。
JS解除右键限制方法二
将以下代码添加进收藏夹,点击执行即可:
javascript:alert(document.onselectstart=document.onbeforecopy=document.oncontextmenu=document.onmousedown=document.onkeydown=function(){returntrue;});void(document.body.onmouseup='');void(document.body.onselectstart='');void(document.body.onmouseup='');void(document.body.oncopy='');
加强的解除右键限制:
javascript:alert(document.onselectstart=document.onbeforecopy=document.oncontextmenu=document.onmousedown=document.onkeydown=function(){returntrue;});void(document.body.onmouseup='');void(document.body.onselectstart='');void(document.body.onmouseup='');void(document.body.oncopy='');javascript:document.body.contentEditable='true';document.designMode='on';void0