-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
46 lines (38 loc) · 1.1 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
<!doctype html>
<html lang="en">
<head>
<title>Ember Debug</title>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
}
#bookmarklet {
background: #dedede;
border-radius: 5px;
padding: 2px 5px;
text-decoration: none;
color: #333333;
}
</style>
</head>
<body>
<h1>Install</h1>
<p>To install the bookmarklet, drag the following link to your bookmarks toolbar.</p>
<p><a id="bookmarklet" href="javascript:alert('something went wrong');">$edb [DEV]</a></p>
<script>
(function() {
"use strict";
let src = new URL("./bookmarklet.js", document.baseURI).href;
let payload = `
javascript:(function(d, s) {
s = d.createElement("script");
s.setAttribute("src", ${JSON.stringify(src)});
d.head.appendChild(s);
})(document);
`;
let href = encodeURI(payload.trim().replace(/\s/g, ""));
document.getElementById("bookmarklet").setAttribute("href", href);
})();
</script>
</body>
</html>