Files
wtyczka-zms/js/intercept.js
RKWojs 1e002d5bd7 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.
2025-06-05 11:32:35 +02:00

12 lines
390 B
JavaScript

// 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 });
}
});