Closed Nauxscript closed 1 year ago
{ redirect: { from: "(.*)", to: "$1" } }
Looks like your redirecting to the very same URL. So repeated listeners calls are to be expected, right?
Looks like your redirecting to the very same URL. So repeated listeners calls are to be expected, right?
Yes, In fact, I only want to monitor the completion of these requests, not to cancel or redirect them. It is achieved based on #1086.
@derjanb Is there a way to monitor the completion status of certain requests? I do not need to redirect or cancel them.
It is usually done with a hook on fetch
, like:
const origFetch = fetch;
unsafeWindow.fetch = async (url, params) => {
console.log("request started", url);
const resp = await origFetch(url, params);
console.log("request finished", url);
return resp;
};
Similar can be done to XMLHttpRequest if it is used.
(Please fill out the issue template with your details)
Expected Behavior
I don’t know, maybe it can provide a parameter to decide whether or not to redirect the request? I only want to listen if a request is completed.
Actual Behavior
Every request triggers the listener twice.
Specifications
Script
After using the above script, when I input something into google.com to trigger the listener, it outputs two logs in the dev-tool, and the network panel records three requests. However, if I disable this script, there is only one request record.