Is it possible to intercept ALL network traffic that occurs in an application? The idea would be that every single request (Ajax, iframe, anchor click, form submit, window.location etc.) gets intercepted and I can add a custom header to the request.
So far, I have used XMLHttpRequest.prototype to capture all Ajax calls. But this doesn’t pick up form submits, for example.
Is this possible in pure JavaScript without having to go and modify every location where a network call is made?