Skip to content

Commit

Permalink
feat: expose gremlins in bookmarklet page
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Haller committed Apr 8, 2020
1 parent 6abb825 commit a03d429
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bookmarklet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,20 @@ <h2 class="code-title">Bookmarklet Code</h2>
document.getElementById('bookmarklet').href = script.replace(/\s\s+/g, ' ');
}

function displayExposedGremlins () {
console.log(`Gremlins is available in your Console. Try gremlins.createHorde().unleash() to unleash the horde !`);
}

function exposeGremlins() {
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://unpkg.com/gremlins.js@next";
script.addEventListener('load', displayExposedGremlins, false)
document.body.appendChild(script);
}

document.getElementById('gremlins-form').addEventListener('input', setBookmarkletScript);

exposeGremlins();
setBookmarkletScript();
</script>

0 comments on commit a03d429

Please sign in to comment.