防F12扒程式碼:按下F12關閉當前頁面

  • 2019 年 12 月 8 日
  • 筆記

<script>    function fuckyou(){        window.close(); //關閉當前窗口(防抽)       window.location="about:blank"; //將當前窗口跳轉置空白頁  }    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();  }  </script>