Unable to debug XHR posts



a year ago
2 months ago


(Reporter: peter, Unassigned)



Firefox Tracking Flags

(firefox57 fix-optional)


(Whiteboard: [specification][type:bug])


(3 attachments)



a year ago
What did you do?
1. open the post from the Network tab in a new browser window - hasn't worked for ages
2. selected Resend in Network tab 

What happened?
There did seem to be a re-post, but no results to be found in the Network tab

What should have happened?
Since option 1 hasn't worked for quite a while, and option 2 is now also dead, debugging XHR posts has become very tedious.

Is there anything else we should know?
With Firefox 54, I was able to:

1) Open in a new tab (Right-click on the JS xhr entry, and select "Open in New Tab")
2) Resend (Right-click and select Edit and Resend, adjust parameters, Send, and view the response)

I believe this page is up-to-date with Firefox Developer Edition, which is a future release, but 90% applies to FF 54 as well:


This feature appears to be working as intended. There may be something specific to your configuration or the website you are browsing - screenshots and test URLs would help diagnose the issue.
Component: General → Developer Tools
Flags: needinfo?(peter)
Product: Mozilla Developer Network → Developer Documentation

Comment 2

a year ago
With the same version I wasn't able to do either - opening it in a new tab was my preferred method, but that hasn't worked in ages. The new tab displays a page with the GET method, so hitting F5 doesn't bring up the repost question, and the page in question doesn't have any POST-data to work with.

The (more cumbersome) resend option doesn't work as intended either - only the single XHR-line is visible (instead of a new one being added as it did previously) and resending doesn't change anything in the Response of that single line.

The POST-data is being sent, mind, and things are saved into databases and stuff, but debugging is near impossible without visible feedback.

The Resend-option not working started immediately after FF was updated to version 54 with the same (local) URL's and code as I've been using for years in the versions before, so test URL's and screenshots won't add much. It's purely a FF issue.
Here's what I did:

1) Go to https://developer.mozilla.org/en-US/dashboards/revisions
2) Open the Network inspector
3) On the Revisions dashboard, click "Next" in the pagination set.

An XHR GET is sent, as seen in the inspector. From here, Open in a new tab and Reset both work. I'll attach a screenshot.

It sounds like it works the same way for you, but you prefer how it worked in previous versions. Moving to Firefox:Netmonitor
Component: Developer Tools → Developer Tools: Netmonitor
Product: Developer Documentation → Firefox
Created attachment 8878845 [details]
About to resend the XHR request

The network tab, showing the "Edit and Resend" interface
Created attachment 8878846 [details]
The resent XHR request

Inspecting the request / response for the resent XHR request

Comment 6

a year ago
Yes, GET works fine. POST however doesn't. Hence the word 'post' in the title and my replies.

For example 
1) Go to https://www.scientias.nl/laatste-100-nieuwsberichten
2) Open Network Inspector
3) Select only XHR
4) Hit F5, if needed
5) Right-click on POST
6) Select "Edit and resend"
7) Click "Send" button

After that, the request details are hidden again, and only the aforementioned POST entry are there, unmodified.

6) Select "Open in new Tab"

The URL is opened in a new tab, with the GET method. Pressing F5 doesn't ask for a resend of data, and the Network Inspector also says it's GET.
Flags: needinfo?(peter)
Thanks for finding a public URL for testing. 

After "Edit and Resend", I see the new request as the last entry (there are two in the screenshot, because I did it twice).  The type of these new entries are "Other", but noted as JS request.  According to the filter, these new entries are "HTML", so they appear when the filter is "All" or includes "HTML", and are not shown for the "XHR" or "Other" filters.  That does smell like a bug to me.  But, if you adjust your filters, you may find Edit and Resend a little more useful.

I had similar experiences as you did with "Open in a new Tab".  The new request is sent as an HTML GET. You can then edit the request to change it to a POST, add in form parameters, change the request headers, etc. This would turn it back into an XHR-type request. It is also a pain and probably not worth it.  "Open in a new tab" only appears useful for GET XHR requests, and even then turns it into an HTML requests, which may be useless based on your backend endpoint.
Created attachment 8878911 [details]
Resend a POST XHR

Resending a POST XHR.  The response type is JS Other, and appears if the filter is All or includes HTML.  It is not included by the filters XHR or Other.

Comment 9

a year ago
I can confirm that they're now of type "HTML", and also that they reflect any changes in the response. Still a pity that the details windows is auto-closed, but hey - beggars can't be choosers.

And like I said, the "Open in new tab" version used to work, too, once, and was far more useful: no right-mouse, select menu option, click send button, click next item in network tab, but simply F5+Enter. If someone could fix that, I'd be a hundred times happier than I am now... ;-)

Comment 10

a year ago
Oh, almost forgot - thank you for your time and effort!
I'm glad we could narrow this down, along with some reproduction steps.  The identified issues:

1) "Edit and Resend" for XHR requests result in a request displayed as JS Other and filtered as HTML
2) "Open in a new tab" sends a GET instead of a POST

Leaving this open, and hopefully the Developer Tools team can use the info for future releases.
status-firefox57: --- → fix-optional
Ever confirmed: true
Priority: -- → P3


2 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.