WordPress限制網站查看源碼 F12 右鍵等功能

WordPress限制網站查看源碼 F12 右鍵等功能-集圖啦

      當下浏覽器還是很多的,如果你想你的網站内容不被人手工采集的話,你的圖片不想被人另存爲或下載的話,我們完全可以禁止右鍵,禁止全站複制;這樣的話:無論是想右鍵查看源代碼還是圖片另存爲都做不到了,連網站文字選中也做不到;

下面教大家一種方法有效禁止限制功能!

将以下代碼複制主題文件 footer.php中即可!

代碼如下:

  1. <script type = ‘text/javascript’ >
  2. //屏蔽右鍵菜單
  3. document.oncontextmenu = function(event) {
  4. if (window.event) {
  5. event = window.event;
  6. }
  7. try {
  8. var the = event.srcElement;
  9. if (!((the.tagName == “INPUT” && the.type.toLowerCase() == “text”) || the.tagName == “TEXTAREA”)) {
  10. return false;
  11. }
  12. return true;
  13. } catch (e) {
  14. return false;
  15. }
  16. }
  17. //屏蔽粘貼
  18. document.onpaste = function(event) {
  19. if (window.event) {
  20. event = window.event;
  21. }
  22. try {
  23. var the = event.srcElement;
  24. if (!((the.tagName == “INPUT” && the.type.toLowerCase() == “text”) || the.tagName == “TEXTAREA”)) {
  25. return false;
  26. }
  27. return true;
  28. } catch (e) {
  29. return false;
  30. }
  31. }
  32. //屏蔽複制
  33. //屏蔽剪切
  34. document.oncut = function(event) {
  35. if (window.event) {
  36. event = window.event;
  37. }
  38. try {
  39. var the = event.srcElement;
  40. if (!((the.tagName == “INPUT” && the.type.toLowerCase() == “text”) || the.tagName == “TEXTAREA”)) {
  41. return false;
  42. }
  43. return true;
  44. } catch (e) {
  45. return false;
  46. }
  47. }
  48. //禁止f12
  49. function fuckyou() {
  50. window.close(); //關閉當前窗口(防抽)
  51. window.location = “about:blank”; //将當前窗口跳轉置空白頁
  52. }
  53. function ck() {
  54. console.profile();
  55. console.profileEnd();
  56. //我們判斷一下profiles裏面有沒有東西,如果有,肯定有人按F12了,沒錯!!
  57. if (console.clear) {
  58. console.clear()
  59. };
  60. if (typeof console.profiles == “object”) {
  61. return console.profiles.length > 0;
  62. }
  63. }
  64. function hehe() {
  65. if ((window.console && (console.firebug || console.table && /firebug/i.test(console.table()))) || (typeof opera == ‘object’ && typeof opera.postError == ‘function’ && console.profile.length > 0)) {
  66. fuckyou();
  67. }
  68. if (typeof console.profiles == “object” && console.profiles.length > 0) {
  69. fuckyou();
  70. }
  71. }
  72. hehe();
  73. window.onresize = function() {
  74. if ((window.outerHeight window.innerHeight) > 200)
  75. //判斷當前窗口内頁高度和窗口高度,如果差值大于200,那麽呵呵
  76. fuckyou();
  77. }
  78. document.onkeydown = function(event) {
  79. if ((event.keyCode == 112) || //屏蔽 F1
  80. (event.keyCode == 113) || //屏蔽 F2
  81. (event.keyCode == 114) || //屏蔽 F3
  82. (event.keyCode == 115) || //屏蔽 F4
  83. // (event.keyCode == 116) || //屏蔽 F5
  84. (event.keyCode == 117) || //屏蔽 F6
  85. (event.keyCode == 118) || //屏蔽 F7
  86. (event.keyCode == 119) || //屏蔽 F8
  87. (event.keyCode == 120) || //屏蔽 F9
  88. (event.keyCode == 121) || //屏蔽 F10
  89. (event.keyCode == 122) || //屏蔽 F11
  90. (event.keyCode == 123)) //屏蔽 F12
  91. {
  92. return false;
  93. }
  94. }
  95. window.onhelp = function() {
  96. return false;
  97. } </script>
常見問題
資源可以不用下載直接在線觀看嗎?
本站是資源均網盤壓縮分享,需要下載解壓後觀看。
下載後提示文件損壞、解壓出錯怎麽辦?
解壓軟件電腦端建議用7z、好壓等正規軟件,安卓建議用"Zarchiver" 蘋果建議用"解壓專家"。
資源如何解壓?
直接找站内解壓教程,裏面有詳細解壓教程,或者自己抖音B站搜索教程學習。
申明:本文資源均來源網友分享,若侵犯了您的權限可以提交工單處理。
此外本文章皆屬于原創文章,轉載請注明出處!原文鏈接:https://www.jitula.com/1621.html
0

評論0

請先

站點公告

【51新活動特惠,永久地址:weme.wang】所有資源禁止百度網盤内解壓,請使用第三方工具解壓,具體軟件參考站内解壓教程!(推薦使用火狐或谷歌浏覽器訪問,個别國産浏覽器可能會無法訪問)。
顯示驗證碼
沒有賬号?注冊  忘記密碼?