Add request interception for getgeoidx API calls

- Introduced a new script (inject.js) to override the fetch and XMLHttpRequest methods to capture requests to the "getgeoidx" endpoint.
- Captured request body and URL, and sent the data to the extension via postMessage.
- Added intercept.js to inject the new script into the page and listen for messages to forward captured data to the extension.
This commit is contained in:
2025-06-05 11:32:35 +02:00
parent 69fc5bcd12
commit 1e002d5bd7
4 changed files with 193 additions and 191 deletions

11
js/intercept.js Normal file
View File

@@ -0,0 +1,11 @@
// inject into page
const s = document.createElement("script");
s.src = chrome.runtime.getURL("js/inject.js");
(document.head||document.documentElement).appendChild(s);
// listen for page→extension
window.addEventListener("message", e => {
if (e.source === window && e.data?.type === "ZMS_CAPTURE") {
chrome.runtime.sendMessage({ command: "CAPTURED", data: e.data.body });
}
});