作者随笔

利用书签方式解除网页禁止右键/复制限制

相信不少网友到某些高大上的网页浏览时会出现这样一个问题,就是右键功能或者选择文字的功能被屏蔽了,这个脚本可以帮助大家解决这一烦恼,简单实用,童叟无欺。
直接拖拽下面的内容到 chrome(浏览器) 的书签栏收藏起来,遇到无法复制的网页,点击这个书签即可解除
其他浏览器也可以~

解除网页禁止右键/复制限制

或者复制以下代码,在浏览器中新建书签,在网址(地址)一栏处粘贴此代码,保存即可。名称任意起。

javascript:(function(){style=document.createElement('style');style.innerHTML='html,*{-webkit-user-select:text!important; -moz-user-select:text!important;}';document.head.appendChild(style);var n,i,e,j,name;d=Array.prototype.slice.call(document.getElementsByTagName("*")),d.push(document),n=["mousedown","mouseup","mousemove","keydown","contextmenu","copy","cut","selectstart","select","dragstart","keyup"];for(i in d){e=d[i];for(j in n)name="on"+n[j],e[name]=function(){return!0}}})()&jQuery(document).unbind()&jQuery('html').unbind()&jQuery('body').unbind();

如以上方法出错可以尝试以下方法解除 (用法同上)
解除网页限制

或者复制以下代码,在浏览器中新建书签,在网址(地址)一栏处粘贴此代码,保存即可。名称任意起。

javascript:(function(){style=document.createElement('style');style.innerHTML='html,*{-webkit-user-select:text!important; -moz-user-select:text!important;}';document.head.appendChild(style);document.onselectstart=document.oncontextmenu=document.oncopy=document.onpaste=document.onmousedown=document.onmouseup=document.onmousemove=document.onkeydown=document.ondragstart=document.body.onselectstart=document.body.oncontextmenu=document.body.oncopy=document.body.onpaste=document.body.onmousedown=document.body.onmouseup=document.body.onmousemove=document.body.onkeydown=document.body.ondragstart=function(){return true}})()&jQuery(document).unbind()&jQuery('html').unbind()&jQuery('body').unbind();
长按保存分享到朋友圈

会飞的猪
我还没有学会写个人说明!
查看“会飞的猪”的所有文章 →

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

相关推荐