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.
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.
Share Improve this question edited Nov 28, 2017 at 20:35 Rm558 asked Nov 21, 2017 at 22:29 Rm558Rm558 5,0124 gold badges42 silver badges47 bronze badges 7- 1 Is this html page is your popup or a normal page? are you inspecting the network for your popup page {right click on popup page>inspect>network} or for a normal page{right click on browser page>inspect>network}? – Abozanona Commented Nov 21, 2017 at 22:33
- Because you create a new window with new page loaded by submit process and that clears all network history from prior window (page) – charlietfl Commented Nov 21, 2017 at 22:33
- @charlietfl As seen in the photo, he has checked the preserve log option, which will not clear the console after it refreshes, right? – Abozanona Commented Nov 21, 2017 at 22:35
- @Yazan W Yusuf, it's a normal page, I simplified a bit. – Rm558 Commented Nov 21, 2017 at 22:37
- Could you please give more details. This script is in a content page, right? – Abozanona Commented Nov 22, 2017 at 0:10
2 Answers
Reset to default 1From https://stackoverflow./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.
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.
DevTools Preferences