54

The Network tab in the Google Chrome Developer Tools window shows almost all http requests made, but does not seem to capture anything when the http request results in a file being downloaded.

How can I capture download requests in Google Chrome?

Ari Seyhun
  • 11,506
  • 16
  • 62
  • 109
  • 1
    I think this may be related [Chrome help forum](https://productforums.google.com/forum/#!topic/chrome/m9RQm5pU1hQ) and [Chrome bugs](https://bugs.chromium.org/p/chromium/issues/detail?id=767189), but that suggests switching off the chrome flag `--enable-browser-side-navigation`. I can't find that flag. The `--navigation-mojo-response` flag sounds similar, but has no effect for me. – whistling_marmot Apr 27 '18 at 08:08
  • And what if you just use WireShark? Chrome developer tools are OK but for this kind of things a proffesional sniffer will help you a lot. – jlvaquero Jan 30 '19 at 09:42
  • You can capture the downloaded document in chrome, it will show as 200 status with type document for example if you are downloading from google drive.you can limit the connection speed to 3G to see it in action. – Anass Kartit Jan 31 '19 at 17:23

8 Answers8

16

I am sure that your file download is happening by opening a new window. Network tab of developer tools only captures the request of current tab.

For example, following link will download the file but it will not appear in the network tab.

<a href="/yourfile.doc" target="_blank">Click Here to Download file</a>

Similar type of things can be done using javascript using (window.open, dynamic hyperlink/iframe), which will not appear in the network tab.

Various Javascript approach you can check here

I have observed similar behaviour in my past.

You cane check the chrome://net-internals in older version of chrome and chrome://net-export/ in the newer version of chrome to monitor any type of request being made by any instance/tab of chrome.

Note: You can check the internal events of chrome by typing chrome://net-export/ in the url box of chrome.

PSK
  • 17,547
  • 5
  • 32
  • 43
8

This works without changing any settings of Chrome for a single download-request. It however does not automatically display all download-requests triggered in a different tab or window.

  1. Trigger the download in the GUI.
  2. Open Chrome's download history (chrome://downloads/).
  3. Right-click your download and Copy link address.
  4. Open DevTools, paste the link into the address bar of the corresopnding Chrome tab and execute it.
  5. The download-request shows in the DevTools.
7

I have faced similar issue, and here's how I solved it.

Issue:

Debug an anchor link that download file upon clicking it.

Debugging Process:

Steps

  1. Go to chrome://settings/content/automaticDownloads?search=download and disable auto download

enter image description here

  1. Open chrome dev tools, Settings -> Global -> Auto-open DevTools for popup

  2. Open chrome dev tools, Settings -> Console -> Preserve log upon navigation

enter image description here

I hope that helps.

Burns
  • 53
  • 4
Alan Dong
  • 3,981
  • 38
  • 35
4

You can use Fiddler for a more grainy look into your network traffic:

https://www.telerik.com/fiddler

*I don't work for fiddler

Code Whisperer
  • 22,959
  • 20
  • 67
  • 85
  • This won't directly answer the question, but serves well as a side solution. Inserting transparent proxy in a way between browser and server may well capture the addresses or even may store a copy of the data transferred from the server, thus effectively downloading the website. – Patrik Staron May 07 '20 at 23:02
0

What do you mean by capture? If you meant that nothing showed up in preview tab or in response tab, it's because the response is the actual file being downloaded. I've recently tried downloading Oracle JDK 11 with dev-tools open in network tab and here is what I got: download screenshot

I have no particular configuration in this version of Chrome (Versione 71.0.3578.98 (Build ufficiale) (a 64 bit))

As @jlvaquero said, if you're trying to get as much details as possibile, try WireShark on your own local pc.

Kerlos Bekhit
  • 128
  • 1
  • 7
0

I can see it in my case by downloading a document from google drive and limit download speed to 3G.

enter image description here

enter image description here

Anass Kartit
  • 2,017
  • 15
  • 22
0

It's true. The download is done in another tab, which is immediately closed upon download completion. The suggested method of Mathias is brilliant and works like a charm : foto to chrome://downloads and copy URL of the download. Then go to the page that displays the link, open the dev tools/network, and then pasted link and hit ENTER. The request is captured and you can get the curl version of the download. Brilliant @Matthias Schuchardt

-1
  1. First step : Open with f12 the programmer toolbar.

  2. Step Two : Go to the networking tab and locate the video in question. To help filter by clicking on media.

  3. Step Three : If the video has no protection you can right click, click open on a new tab and download with crtl + s. If this does not work is because the video has parameters to prevent it from doing so. In that case right click again, go to the COPY session and then click copy as cURL.

  4. Step Four : Go to your linux terminal (If you use windows turn around), if you don't have curl installed type sudo apt install curl and then paste the copied CURL command from the developer bar.

  5. Step 5 : Before executing the command you need to add at the end of it --output video.mp4 --insecure as it is a binary. The insecure parameter is if you have problem with certificate. Wait for the download to complete and be happy!

Obs: This link can help you: https://www.hanselman.com/blog/HowToDownloadEmbeddedVideosWithF12ToolsInYourBrowser.aspx

XPD
  • 1,121
  • 1
  • 13
  • 26