当前位置:首页 > 技术博文 > 正文

网页禁止复制、禁止图片保存、禁止F12模式代码

先来禁止页面复制,分别有两种方法,代码放入你的模板里,和放入你的主CSS文件里!mM3源是物语
mM3源是物语
放入模板的方法:复制下面的代码放入你模板的</head>前面mM3源是物语
mM3源是物语
<style type="text/css"> body { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } </style>mM3源是物语
或者,放入你的主CSS文件里,打开你的主CSS文件,文件头部加入以下代码:mM3源是物语
mM3源是物语
body { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }mM3源是物语
然后我们做禁止保存图片和禁止按F12进入开发者模式mM3源是物语
mM3源是物语
也是两种方法,第一种放模板里,第二种放你的主JS文件里mM3源是物语
mM3源是物语
放入模板里的方法:复制以下代码放入你的模板最后mM3源是物语
mM3源是物语
<script type="text/javascript"> var img=$("img"); img.on("contextmenu",function(){return false;}); img.on("dragstart",function(){return false;}); //禁止审查元素 function fuckyou(){ window.close(); window.location="about:blank"; } function ck() { console.profile(); console.profileEnd(); 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) fuckyou(); } document.oncontextmenu = function() { return false; } </script>mM3源是物语
或者放入你的主JS文件里,打开你的主JS文件,在最后加入如下代码:mM3源是物语
mM3源是物语
var img=$("img"); img.on("contextmenu",function(){return false;}); img.on("dragstart",function(){return false;}); //禁止审查元素 function fuckyou(){ window.close(); window.location="about:blank"; } function ck() { console.profile(); console.profileEnd(); 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) fuckyou(); } document.oncontextmenu = function() { return false; }
在线下载列表

发表评论

  • 人参与,条评论

热门阅读

最新文章

取消
扫码支持 支付码