Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 845
Rm558 Avatar asked Nov 21 '17 22:11

Rm558


People also ask

Why can't I capture a file download request in Chrome Dev tool?

It has a tricky situation: If you submit a post form, then Chrome will open a new tab to send the request. It's right until now, but if it triggers an event to download file (s), this tab will close immediately so that you cannot capture this request in the Dev Tool.

How to view submitted FORM data in Chrome Developer Tools?

View Submitted Form Data in Chrome If you’ve ever needed to inspect the form data after submitting a form on a web page, you should take a look a closer look at the Network panel in Chrome developer tools. You can click on an HTTP request, which for a POST request is typically the first one in the list after a form submission.

How do I Capture network activity in the browser?

Most browser Developer Tools have a "Network" tab that allows you to capture network activity between the browser and the server. Microsoft Edge (Chromium) Open the DevTools. Select F12; Select Ctrl+Shift+I (Windows/Linux) or Command+Option+I (macOS) Select Settings and more and then More Tools > Developer Tools; Select the Network Tab

How do I debug a network request in Chrome DevTools?

Open Chrome DevTools (Cmd+Opt+I on Mac, Ctrl+Shift+I or F12 on Windows) and click on the "Network" tab. Click on the "Filter" icon. Enter your filter method: method:POST. Select the request you want to debug.


1 Answers

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.

like image 57
Nokados Avatar answered Oct 29 '22 04:10

Nokados