當下浏覽器還是很多的,如果你想你的網站内容不被人手工采集的話,你的圖片不想被人另存爲或下載的話,我們完全可以禁止右鍵,禁止全站複制;這樣的話:無論是想右鍵查看源代碼還是圖片另存爲都做不到了,連網站文字選中也做不到;
下面教大家一種方法有效禁止限制功能!
将以下代碼複制主題文件 footer.php中即可!
代碼如下:
- <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”; //将當前窗口跳轉置空白頁
- }
- 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>
常見問題
資源可以不用下載直接在線觀看嗎?
本站是資源均網盤壓縮分享,需要下載解壓後觀看。
下載後提示文件損壞、解壓出錯怎麽辦?
解壓軟件電腦端建議用7z、好壓等正規軟件,安卓建議用"Zarchiver" 蘋果建議用"解壓專家"。
資源如何解壓?
直接找站内解壓教程,裏面有詳細解壓教程,或者自己抖音B站搜索教程學習。
申明:本文資源均來源網友分享,若侵犯了您的權限可以提交工單處理。
此外本文章皆屬于原創文章,轉載請注明出處!原文鏈接:https://www.jitula.com/1621.html
此外本文章皆屬于原創文章,轉載請注明出處!原文鏈接:https://www.jitula.com/1621.html
評論0