Display Transit EDN in Network Panel's request preview
Similar to JSON display.
This would be great!
@darwin I just copied here a reformatted version of what you wrote on Slack to preserve it:
Just briefly looked at the devtools sources, web socket data frames and normal network request previews are handled differently. Web socket frame can be either text or binary and devtools creates corresponding view for it (in case of text type, it creates JSON view), no detection of mime type or anything like that. In network requests it tries to look at response headers or request headers and then interpret the mime type. https://github.com/binaryage/dirac/blob/cff8e6c40b7a989744b70d40eff918f3221c5b2d/resources/unpacked/devtools/front_end/network/ResourceWebSocketFrameView.js#L179-L197
Actually if JSON view cannot be provided, it falls back to Common.resourceTypes.WebSocket type, whatever it is.
Here seems to be the logic for normal network requests: https://github.com/binaryage/dirac/blob/cff8e6c40b7a989744b70d40eff918f3221c5b2d/resources/unpacked/devtools/front_end/network/RequestResponseView.js#L75-L91
We would have to implement a new SourceFrame.ResourceSourceFrame type and detect packed transit there.
To add a suggestion - maybe it would be worth it to not detect anything but rather to allow users to select what the actual mime type is. Although I'm not sure it that would be possible via the UI, but I'm perfectly fine with having to specify a config option for it. Especially if it would support any custom type (e.g. transit allows extensions - no level of detection could handle that).