-
Notifications
You must be signed in to change notification settings - Fork 24
/
bookmarklet.html
58 lines (52 loc) · 1.35 KB
/
bookmarklet.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
<!doctype html>
<html>
<head>
<title>Lag Radar - Bookmarklet</title>
<link rel="stylesheet" href="index.css">
<link rel="shortcut icon" type="image/png" href="./lag-radar.png">
<style>
#bookmarklet {
display: block;
border: 1px solid #2a2;
width: 300px;
margin: 30px auto;
border-radius: 5px;
padding: 10px;
color: white;
text-decoration: none;
}
#bookmarklet:hover {
background: #183018;
}
#bookmarklet::after {
content: "Drag this to your Bookmark Bar";
margin: 10px;
display: block;
font-size: 75%;
color: #aaa;
}
VIDEO {
margin: 40px auto;
}
</style>
</head>
<body>
<h1>Lag Radar - Bookmarklet</h1>
<a href="#" id="bookmarklet">Lag Radar</a>
<script type="module">
import lagRadar from './lag-radar.js';
import lagRadarUI from './lag-radar-ui.js';
function linkSource() {
return (
'javascript: (function(){'
+ lagRadar.toString() + ';'
+ lagRadarUI.toString() + ';'
+ 'lagRadarUI();'
+ '})()'
).replace(/\/\/.*/g, '').replace(/\s+/gm, ' ');
}
document.querySelector('#bookmarklet').setAttribute('href', linkSource());
</script>
<video width="532" height="458" autoplay="true" loop="true" src="bookmarklet.mp4"></video>
</body>
</html>