mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 19:43:42 +02:00
14 lines
No EOL
450 B
JavaScript
14 lines
No EOL
450 B
JavaScript
import { default as Glitch } from "./glitch/Glitch.mjs";
|
|
|
|
const logging = "https://victorwesterlund-logging-dnzfgzf6za-lz.a.run.app";
|
|
|
|
// Log link clicks
|
|
for(let link of document.getElementsByTagName("a")) {
|
|
link.addEventListener("click", event => {
|
|
event.preventDefault();
|
|
navigator?.sendBeacon(logging, event);
|
|
window.location.href = event.target.href;
|
|
});
|
|
}
|
|
|
|
window.glitch = new Glitch(document.body.parentElement); |