I’ve started in full-stack dev recently, and these days I use XHR to fetch any sensitive data from my server.
As we know, there is a network tab in many browsers, which keeps track of XHR request and response. But, since
POST data’s are sensitive, I want to hide them on the client-side. I already know how to clear the console, but is it possible to clear the network tab too?
I’m asking this bcoz there is a button to clear the network tab manually, can it be done in JS somehow? If not, then are there any efficient alternatives to XHR?
I don’t think so. Here are a few alternatives
An alternative to XHR is fetch which to be honest I haven’t tried out yet but I heard it’s supposed to be easier to use.
Yes, as @javaarchive said, an efficient alternative to XHR is the Fetch API.
To get started: Using Fetch - CSS-Tricks
The whole Fetch API documentation: Fetch API - Web APIs | MDN
BTW, by sensitive info. I’m talking about otp, and I’m mailing it to client’s mail by OAuth2 api. After that, I get the otp on client-side in
xhr.responseText, in order to verify it.
@javaarchive, I guess encryption would do the trick!
@khalby786, I just tried fetch, and it is also showing up the response data in net. By “alternative”, I actually meant a thing that can hide the responses. But, now I think, that’s impossible…