adding bookmarklet

This commit is contained in:
Benjamin Boudreau
2018-06-03 16:01:32 -04:00
parent 5a2184062e
commit 799221f411
11 changed files with 60 additions and 15 deletions

View File

@@ -8,7 +8,14 @@
<ul>
<li><a href="./blank.html">Widget on a blank page</a></li>
<li><a href="./embeddable-widget.js">Latest version of the widget</a></li>
<li><a href="./bookmarklet.js">Bookmarklet (Bookmark it for easy use)</a></li>
<li><a id="bookmarklet">Bookmarklet (Bookmark it for easy use)</a></li>
<li><a href="./bookmarklet.js">Bookmarklet Code</a></li>
<script>
var bookmarklet = "var s= document.createElement('script'); s.setAttribute('src', '"+window.location.href+"bookmarklet.js'); s.setAttribute('crossorigin', 'anonymous'); document.body.appendChild(s);"
bookmarklet = '(function(){'+ bookmarklet +'})();'
document.querySelector('a#bookmarklet').setAttribute("href", "javascript:" + encodeURIComponent(bookmarklet));
console.log("DONE");
</script>
</ul>
</body>
</html>