Rm558
Rm558

Reputation: 4994

Chrome developer tool does Not capture a form submit in network tab, Why?

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

Upvotes: 10

Views: 4657

Answers (2)

Kael
Kael

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.

DevTools Preferences

Upvotes: 1

Nokados
Nokados

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

Related Questions