I'm working on a single page application that incorporates a third party tool for analytics (think heap, segment, mixpanel, etc.). I'd like to be able to monitor the outgoing https requests from my app and perform some actions (logging for example) accordingly.
Is there a browser agnostic / procotol agnostic way of doing this? (a js library would be fine). From what I found my options are to create handlers for individual types of requests. For example, for xhr requests I could use this and for fetch requests I could use this.
Thanks.