-
Notifications
You must be signed in to change notification settings - Fork 1
/
MirrorProtection.html
57 lines (57 loc) · 2.9 KB
/
MirrorProtection.html
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
<!DOCTYPE html>
<html>
<head>
<title>Tool.js - 禁止镜像站(MirrorProtection)</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/i18n/zh_CN.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/method.min.js"></script>
</head>
<body>
<div class="vditor-reset" id="preview">
<h2>如果你是访问者</h2>
<div id="interviewer"></div>
<h2>如果你是原网站站长</h2>
<div id="Former webmaster"></div>
<h2>如果你是镜像站站长</h2>
<p>请你不要镜像原网站,谢谢!所有著作权归原网站所有!</p>
<script>
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for(var i=0;i<vars.length;i++){
var pair = vars[i].split("=");
if(pair[0]== variable){return pair[1];}
}
return('');
}
document.getElementById('interviewer').innerHTML='<p>你访问的是镜像站,请访问:</p><a href="'+getQueryVariable('url')+'" >原网站</a>';
document.getElementById('Former webmaster').innerHTML='<p>本工具拦截一个镜像站:'+getQueryVariable('uri')+'</p>';
</script>
<h2>如何使用</h2>
<pre><code class="language-HTML"><script src="https://cdn.jsdelivr.net/gh/Fgaoxing/Tool-js/tool.js"></script>
<!--禁止在域名后加斜杠-->
<script>MirrorProtection("域名");</script>
</code></pre>
</div>
<script>
const previewElement = document.getElementById('preview')
Vditor.setContentTheme('light', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/content-theme');
Vditor.codeRender(previewElement);
Vditor.highlightRender({"enable":true,"lineNumber":false,"style":"github"}, previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]');
Vditor.mathRender(previewElement, {
cdn: 'https://cdn.jsdelivr.net/npm/[email protected]',
math: {"engine":"KaTeX","inlineDigit":false,"macros":{}},
});
Vditor.mermaidRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]', 'classic');
Vditor.flowchartRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]');
Vditor.graphvizRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]');
Vditor.chartRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]', 'classic');
Vditor.mindmapRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]', 'classic');
Vditor.abcRender(previewElement, 'https://cdn.jsdelivr.net/npm/[email protected]');
Vditor.mediaRender(previewElement);
Vditor.speechRender(previewElement);
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/icons/ant.js"></script>
</body>
</html>