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:
11
js/intercept.js
Normal file
11
js/intercept.js
Normal 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 });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user