把下面代码放到footer.php里即可。
<script> 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)>100) fuckyou(); } </script> <script> document.onkeydown=function (e){ var currKey=0,evt=e||window.event; currKey=evt.keyCode||evt.which||evt.charCode; if (currKey == 123) { window.event.cancelBubble = true; window.event.returnValue = false; } } </script> <script type="text/Javascript"> document.oncontextmenu=function(e){return false;}; document.onselectstart=function(e){return false;}; </script> <style> body{ -moz-user-select:none; } </style> <SCRIPT LANGUAGE=javascript> if (top.location != self.location)top.location=self.location; </SCRIPT> <noscript><iframe src=*.html></iframe></noscript>
此代码实现:
1、禁止鼠标左键选取内容。
2、禁止鼠标右键复制功能。
3、禁止使用ctrl键,无法复制。
4、禁止F12,火狐也禁止
未经允许不得转载:哈勃私语 » 实现wordpress禁止复制内容的方法
本文共1220个字 创建时间:2017年3月23日17:35