首页
友链
壁纸
留言
今日热榜
更多
关于
时光
推荐
精品流量卡
Search
1
都二十多年了,你的梦为什么还没碎!
57,108 阅读
2
2022年5个好用的 BT/ 磁力链接下载工具推荐 |Windows 、安卓系统
37,512 阅读
3
nps内网穿透实现外网访问树莓派
32,450 阅读
4
实践利用宝塔建emlog个人博客-超详细【原创】
26,147 阅读
5
Typecho-Joe-Theme主题帮助文档
24,710 阅读
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
登录
Search
标签搜索
PHP
HTML
API
Javascript
源码
JS
Vue
Github
CloudFlare
接口
函数
SQL
ASP.NET
MVC
EF
T4模板
后台管理
CDN
微信小程序
MAC
韩小韩
累计撰写
262
篇文章
累计收到
1,312
条评论
首页
栏目
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
页面
友链
壁纸
留言
今日热榜
关于
时光
推荐
精品流量卡
搜索到
1
篇与
屏蔽审查元素
的结果
2020-06-09
JavaScript屏蔽右键F12和Ctrl+U等绝大部分按键
网站被别人抓包?被别人审查?被别人扒?代码直接插入网页,不会的话,百度一下。<script type='text/javascript'> //屏蔽右键菜单 document.oncontextmenu = function (event) { if (window.event) { event = window.event; } try { var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { return false; } return true; } catch (e) { return false; } } //屏蔽粘贴 document.onpaste = function (event) { if (window.event) { event = window.event; } try { var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { return false; } return true; } catch (e) { return false; } } //屏蔽复制 //屏蔽剪切 document.oncut = function (event) { if (window.event) { event = window.event; } try { var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { return false; } return true; } catch (e) { return false; } } //禁止f12 function fuckyou() { window.close(); //关闭当前窗口(防抽) window.location = "about:blank"; //将当前窗口跳转置空白页 } //禁止Ctrl+U var arr = [123, 17, 18]; document.oncontextmenu = new Function("event.returnValue=false;"), //禁用右键 window.onkeydown = function (e) { var keyCode = e.keyCode || e.which || e.charCode; var ctrlKey = e.ctrlKey || e.metaKey; console.log(keyCode + "--" + keyCode); if (ctrlKey && keyCode == 85) { e.preventDefault(); } if (arr.indexOf(keyCode) > -1) { e.preventDefault(); } } function ck() { console.profile(); console.profileEnd(); //我们判断一下profiles里面有没有东西,如果有,肯定有人按F12了,没错!! if (console.clear) { console.clear() }; if (typeof console.profiles == "object") { return console.profiles.length > 0; } } function hehe() { if ((window.console && (console.firebug || console.table && /firebug/i.test(console.table()))) || ( typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)) { fuckyou(); } if (typeof console.profiles == "object" && console.profiles.length > 0) { fuckyou(); } } hehe(); window.onresize = function () { if ((window.outerHeight - window.innerHeight) > 200) //判断当前窗口内页高度和窗口高度,如果差值大于200,那么呵呵 fuckyou(); } document.onkeydown = function (event) { if ((event.keyCode == 112) || //屏蔽 F1 (event.keyCode == 113) || //屏蔽 F2 (event.keyCode == 114) || //屏蔽 F3 (event.keyCode == 115) || //屏蔽 F4 // (event.keyCode == 116) || //屏蔽 F5 (event.keyCode == 117) || //屏蔽 F6 (event.keyCode == 118) || //屏蔽 F7 (event.keyCode == 119) || //屏蔽 F8 (event.keyCode == 120) || //屏蔽 F9 (event.keyCode == 121) || //屏蔽 F10 (event.keyCode == 122) || //屏蔽 F11 (event.keyCode == 123)) //屏蔽 F12 { return false; } } window.onhelp = function () { return false; } </script>
2020年06月09日
1,372 阅读
2 评论
0 点赞