With the current API, it is very hard to know what is going on with XHR requests inside the page. You can hook 'xhr' event on the browser/window, but that only gives you eventName (loadstart, load, error, ...) and the url that was accessed. People (like me) who need precise timing information can hook the resource pipeline - only then it is really hard to figure out something is a XHR request.
Ideally, I would like to receive events on a target that is accessible to me, containing more information but at the very least:
xhr instance - so I can interact with it directly and also as a form of 'request identity'
the actual 'event' - not just the eventName
the url requested (works today)
You could for example make this look as follows:
const browser = new Browser()
browser.on('xhrDebug', (event, url, xhr) => {
// Do something with the event here: xhr uniquely identifies this request
})
I realise that this would be the first such API that is only targeted at zombie users (non-web API). Are you interested in such a contribution at all?
With the current API, it is very hard to know what is going on with XHR requests inside the page. You can hook 'xhr' event on the browser/window, but that only gives you
eventName
(loadstart, load, error, ...) and theurl
that was accessed. People (like me) who need precise timing information can hook the resource pipeline - only then it is really hard to figure out something is a XHR request.Ideally, I would like to receive events on a target that is accessible to me, containing more information but at the very least:
You could for example make this look as follows:
I realise that this would be the first such API that is only targeted at zombie users (non-web API). Are you interested in such a contribution at all?