10

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.

enter image description here

any idea? thanks in advance.

Update: Firefox is working well on capturing this. enter image description here

Rm558
  • 4,621
  • 3
  • 38
  • 43
  • 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 Nov 21 '17 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 Nov 21 '17 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 Nov 21 '17 at 22:35
  • @Yazan W Yusuf, it's a normal page, I simplified a bit. – Rm558 Nov 21 '17 at 22:37
  • Could you please give more details. This script is in a content page, right? – Abozanona Nov 22 '17 at 00:10
  • Yes, it is in the same content page. or run it directly in console tab. – Rm558 Nov 22 '17 at 05:13
  • Try this: https://stackoverflow.com/questions/15603561/how-can-i-debug-a-http-post-in-chrome – Dan K. Jun 03 '19 at 18:14

1 Answers1

1

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.

Nokados
  • 191
  • 1
  • 5