Replies: 1 comment
-
Not Currently, it's in backlog, I except to do it this year. Till then you can use code like (function () {
if (window.hasRun) {
return
}
window.hasRun = true
// Store the original fetch function in a variable
const originalFetch = window.fetch
window.fetch = async function (...args) {
if (true) {
try {
// Call the original fetch function
const response = await originalFetch.apply(this, args)
// Clone the response to not interfere with the original processing
const clonedResponse = response.clone()
// Read the response as JSON and log it
clonedResponse.json().then(json => {
console.log(json)
})
// Return the original response
return response
} catch (error) {
console.error('Error in fetch interceptor:', error)
throw error // Re-throw the error for proper error handling
}
}
else {
// Call the original fetch function for other URLs
return originalFetch.apply(this, args)
}
}
})()``` |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, it doesn't look like it, but does this library allow for request/response interception similar to selenium-wire? I'm getting detected using selenium-wire and UC so am interested in a different solution.
Beta Was this translation helpful? Give feedback.
All reactions