两种解除禁止右键、选中、复制的方法

 

我在网上找的 两种解除禁止右键、选中、复制的方法
1、直接存到书签点击即可

javascript:(function(){var doc=document;var bd=doc.body;bd.onselectstart=bd.oncopy=bd.onpaste=bd.onkeydown=bd.oncontextmenu=bd.onmousemove=bd.onselectstart=bd.ondragstart=doc.onselectstart=doc.oncopy=doc.onpaste=doc.onkeydown=doc.oncontextmenu=null;doc.onselectstart=doc.oncontextmenu=doc.onmousedown=doc.onkeydown=function(){return true};with(document.wrappedJSObject||document){onmouseup=null;onmousedown=null;oncontextmenu=null}var arAllElements=document.getElementsByTagName('*');for(var i=arAllElements.length-1;i>=0;i--){var elmOne=arAllElements;with(elmOne.wrappedJSObject||elmOne){onmouseup=null;onmousedown=null}}alert(unescape('%u5DF2%u4E3A%u4F60%u89E3%u9669%u7F51%u9875%u53F3%u952E%u9650%u5236'));bd.style.webkitUserSelect='auto!important';bd.style.MozUserSelect='text!important';})()



2、直接存到书签点击即可

javascript:alert(document.onselectstart = document.oncontextmenu= document.onmousedown = document.onkeydown= function(){return true;});



感谢大佬@ppj975 提供的两种解除不可粘贴的代码,如下:
1、直接存到书签点击即可

[JavaScript] 纯文本查看 复制代码

1

javascript:(function()%7Bdocument.querySelectorAll('%5Bonpaste%5D').forEach(i%3D%3Ei.attributes.onpaste.value%3D'')%7D)()


2、需要用控制台运行此代码

[JavaScript] 纯文本查看 复制代码

1

document.querySelectorAll('[onpaste]').forEach(i=>i.attributes.onpaste.value='')

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

网络毒刘

授人玫瑰,手有余香。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值