-1

I have a block where I display a video using blob, I just want to hide a video into a devtools network.

HIDE THIS

Here is what I have tried so far

<video id="videoplayer" playsinline autoplay controls>
  <source src="" type="video/mp4">
</video>
window.onload = function() {
  var xhr = new XMLHttpRequest();
  xhr.open('GET', '/videos/mena.mp4', true);
  xhr.responseType = 'blob'; //important
  xhr.onload = function(e) {
    if (this.status == 200) {
      console.log("loaded");
      var blob = this.response;
      var video = document.getElementById('videoplayer');
      video.oncanplaythrough = function() {
        console.log("Can play through video without stopping");
        URL.revokeObjectURL(this.src);
      };
      video.src = URL.createObjectURL(blob);
      video.load();
    }
  };
  xhr.send();
}

The above function generates this link below perfectly as I want:

blob:http://localhost:8080/bb58f8d4-a5b8-43e2-99f4-7a4a7bbfe60c

if you visit youtube video and inspect a video there is no link displayed in devtools

enter image description here

How can I hide the mp4 link in devtools network?

The Dead Man
  • 6,258
  • 28
  • 111
  • 193
  • 2
    It's not possible to hide any requests that the browser is making from dev tools. – Rory McCrossan Apr 18 '19 at 09:46
  • How does youtube manage to do that? check my update on my question – The Dead Man Apr 18 '19 at 09:57
  • 1
    Youtube doesn't manage it: https://i.imgur.com/JN9kcMI.png. All the `videoplayback?...` calls are calls to retrieve chunked sections of the video data. It's possible the data has been cached in the video you're watching, so no calls are being made. – Rory McCrossan Apr 18 '19 at 10:02
  • Rory if you open that videoplayback displays something like this :https://www.youtube.com/watch?v=75GuuDa-TSY&list=OLAK5uy_n0jeHsvODxi-Hta65ZY_LPATbAUaSEsfU&index=7 there is not direct acces to video through devtools – The Dead Man Apr 18 '19 at 10:10
  • You might find this answer interesting: [How to get direct url for youtube videos](https://stackoverflow.com/a/37779863/924299). The code "works directly from the dev tools console available in any browser." I get links like this: `https://r2---sn-a5mlrnes.googlevideo.com/videoplayback?signature=...` – showdev Apr 18 '19 at 10:15
  • Yes there is, via the data in the `videoplayback?` calls. Sure you'll need to stitch it all back together, but that's due to how YT chunks the data in order to send it in sections to save bandwidth. In your case you're downloading a single file, so it's far simpler to receive the file URL. In any case, the overriding point here is that you cannot hide any traffic from being displayed in dev tools. – Rory McCrossan Apr 18 '19 at 10:16
  • 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:19

1 Answers1

0

It's not possible hide a file with a file with specific MIME type in DevTools ‘Network’ tab.


The link couldn't be hidden.

tripulse
  • 1,059
  • 11
  • 18