2

Hi I was wondering if there is any way to hide the variable displayed in the network tab of the chrome dev tools. I am trying to create a Treasure Hunt Game in google street view using HTML. I download the prize location from a database and for the the street view to work I have to json_encode() it in php. But this means I have to echo it which then results in it showing up in the network tab which any person can access and find the prize with no trouble.

Any help is appreciated :)
If you need the code just ask and Ill update the post to include what you desire.

William Sharp
  • 55
  • 1
  • 10
  • Does this answer your question? [Is it possible to hide network traffic from a browsers developer console?](https://stackoverflow.com/questions/54487643/is-it-possible-to-hide-network-traffic-from-a-browsers-developer-console) – Nico Haase May 05 '23 at 11:20

1 Answers1

0

You cannot hide browser's requests from the user that is running that browser.

Most secure way to this would be to send the user's google map location to the API and the API would respond either that the prize is not there, or is there a prize at that location and the prize in that location is X.

There are few ways to "hide" them or actually make them less obvious to find;

Make a JSONP request, they are not real AJAX calls, as they do not use the XMLHttpRequest object. They simply inject a script tag in the dom, the requests are still visible in the network tab.

You can also clear console via script among the lines of;

function clearConsole() { 
    if(window.console || window.console.firebug) {
       console.clear();
    }
}
Community
  • 1
  • 1
MrGoofus
  • 876
  • 6
  • 15