网站被别人抓包?被别人审查?被别人扒?

代码直接插入网页,不会的话,百度一下。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<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"; //将当前窗口跳转置空白页
}
//禁止Ctrl+U
var arr = [123, 17, 18];
(document.oncontextmenu = new Function("event.returnValue=false;")), //禁用右键
(window.onkeydown = function (e) {
var keyCode = e.keyCode || e.which || e.charCode;
var ctrlKey = e.ctrlKey || e.metaKey;
console.log(keyCode + "--" + keyCode);
if (ctrlKey && keyCode == 85) {
e.preventDefault();
}
if (arr.indexOf(keyCode) > -1) {
e.preventDefault();
}
});

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>