Skip to content

Commit

Permalink
exec
Browse files Browse the repository at this point in the history
  • Loading branch information
callionica committed Jul 12, 2024
1 parent f4aa87f commit 35e7922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion five-hours.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
</header>
<body>
<p>5 hours to kill</p>
<p><a href='javascript:(function(){const e = document.createElement("script"); e.type="module"; e.src="https://callionica.github.io/five-hours.js"; document.body.appendChild(e);})();'>Shortcut</a></p>
<p><a href='javascript:(function(){ const name = "five-hours"; const fn = globalThis[name]; if (fn === undefined) { const e = document.createElement("script"); e.type="module"; e.src="https://callionica.github.io/five-hours.js"; document.body.appendChild(e); } else { fn(); } })();'>Shortcut</a></p>
</body>
8 changes: 7 additions & 1 deletion five-hours.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
alert("5 Hours");
const name = "five-hours";

globalThis[name] = function () {
alert("5 Hours");
};

globalThis[name]();

0 comments on commit 35e7922

Please sign in to comment.