本文主要是介绍【相见恨晚】轻松解决解除网页文字复制限制,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
你有没有遇到过复制一段文字就要登陆掏钱之类的问题?
这篇博文就来帮你解决这个问题
完成接下来的配置后,在限制复制的网页上,点击一下书签
即可解除限制
之后就可以快乐的复制啦
傻瓜教程
1. 先复制以下代码
javascript:"use strict";!function(){var t=function(t){t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation()};["copy","cut","contextmenu","selectstart","mousedown","mouseup","keydown","keypress","keyup"].forEach(function(e){document.documentElement.addEventListener(e,t,{capture:!0})}),alert("BaBy:success")}();
2. 添加到书签栏方便使用
源码
javascript:"use strict";!function(){var t=function(t){t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation()};["copy","cut","contextmenu","selectstart","mousedown","mouseup","keydown","keypress","keyup"].forEach(function(e){document.documentElement.addEventListener(e,t,{capture:!0})}),alert("BaBy:success")}();
格式化源码(!不要复制这个使用)
javascript:"use strict";// 严格模式
!function () {var t = function (t) {t.stopPropagation(),// 停止事件传播t.stopImmediatePropagation && t.stopImmediatePropagation() // 阻止事件冒泡至父节点,阻止当前节点上其他同类型事件的触发};["copy", "cut", "contextmenu", "selectstart", "mousedown", "mouseup", "keydown", "keypress", "keyup"].forEach(function (e) {document.documentElement.addEventListener(e, t, {capture: !0})}), alert("BaBy:success")
}();
这篇关于【相见恨晚】轻松解决解除网页文字复制限制的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!