Reputation: 4994
a simple html page,
<body>
<form method="POST" action="abc">
<input ... />
</form>
</body>
submit the form with javascript
document.getElementsByTagName('form')[0].submit()
The request was indeed submitted (the server return a file as download), but I could not find any activity in network tab.
any idea? thanks in advance.
Update:
Firefox is working well on capturing this.
Upvotes: 10
Views: 4657
Reputation: 11
The solution to go offline before starting a download didn't work for me, but I've found a better one.
Enable the Auto-open DevTools for popups option in DevTools preferences. It makes Chrome open the DevTools window for a new window/tab of the download URL just before the Save dialog appears.
Upvotes: 1
Reputation: 451
From https://stackoverflow.com/a/55197547/3774338
If it triggers an event to download a file, Chrome will create a new tab and this tab will be closed immediately so that you cannot capture this request in Dev Tools.
Solution: check 'Offline' checkbox at the network tab, which will fail to send the request, so the tab will not be closed.
Upvotes: 1