xmlfirefoxdevtoolsfirefox-developer-tools

Is there a way to set Firefox Devtools to indent XML in the network view?


I am working with an application still using XML instead of JSON in its REST API, and when I check the queries in the network tab of Firefox, the request or the response are displayed on a single line:

screenshot of Firefox Devtools network tab

So I have to copy it and then paste it in my IDE to have it indented and readable, and this each time I am looking at a query. That is very time consuming, so I was wondering if there was a setting somewhere (maybe in about:config or idk) or an addon to set Firefox to automatically indent the request and response payloads.

Thank you.


Solution

  • There is currently (as of Firefox 131.0) no direct option to get a formatted output for XML responses, unfortunately.

    There is a long-standing request to add this feature to the DevTools, though.

    A workaround for this may be to right-click the request and choose the option "Open in New Tab" from the context menu. This should then allow you to see the XML either directly within the viewport or using the Inspector panel of the DevTools, e.g.

    Example XML response shown within the browser viewport and within the DevTools' Inspector panel