-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
96 lines (95 loc) · 3.86 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>百度统计插件生成器</title>
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<style>
* {
padding: 0;
margin: 0;
}
#container {
width: 1000px;
margin: auto;
}
</style>
</head>
<body onload="main()">
<header style="background-color: #333;padding: 10px;margin-bottom: 20px;">
<section style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;width: 1000px;margin: auto;">
<h1 style="color: #fff;">百度统计插件生成器</h1>
<iframe src="https://ghbtns.com/github-btn.html?user=krapnikkk&repo=baidutongji-generator&type=star" frameborder="0" scrolling="0" width="90px" height="21px"></iframe>
</section>
</header>
<section id="container">
<section>
<section class="panel panel-default">
<section class="panel-body">
<p style="font-weight: 700; font-size: 18px;">本工具用于辅助生成百度统计插件在file和chrome-extension等协议环境下【如:electron、chrome extension】能正常上报统计信息的本地插件文件。</p>
</section>
</section>
</section>
<section>
<h3>登录百度统计官网新增网站:</h3>
<a href="https://tongji.baidu.com/" target="_blank">点击登录百度统计官网</a>
</section>
<section>
<h3>加载并手动复制百度统计插件代码:</h3>
<textarea
class="form-control"
name="code"
id="code"
placeholder="请输入百度统计获取到的统计代码。参考:
<script\>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?3f46885080d327e37b00c5879a6f0fb5';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
</script\>"
cols="80"
rows="10"
></textarea>
<button class="btn btn-primary" style="margin: 10px;" type="button" id="load">加载插件</button>
</section>
<section>
<h3>黏贴百度统计插件代码并生成本地文件:</h3>
<textarea
class="form-control"
id="source"
name="code"
placeholder="请输入弹窗加载的插件代码"
cols="80"
rows="10"
></textarea>
<button id="download" class="btn btn-primary" style="margin: 10px;" type="button">生成插件</button>
</section>
<section>
<h3>使用说明:</h3>
<p>将下载到的hm.js文件通过script标签的形式引入插件即可使用</p>
<!-- <p> -->
<pre><script type="text/javascript" src="hm.js"></script></pre>
<!-- </p> -->
<p>在chrome-extension中需要在manifest.json中添加以下配置</p>
<pre>"content_security_policy": "script-src 'self' 'unsafe-eval' https://hmcdn.baidu.com; object-src 'self'"</pre>
</section>
<section>
<h3>开发日志:</h3>
<a href="https://krapnikkk.github.io/2022/02/14/baidutongji-generator/" target="_blank">点击跳转</a>
</section>
</section>
<footer style="text-align: center;
color: #333;
margin: 10px;
position: absolute;
bottom: 0;
right: 50%;
left: 50%;">©krapnik</footer>
</body>
</html>