Pretty printing in the Response side panel
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: Honza, Unassigned)
References
(Blocks 1 open bug)
Details
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Comment 2•7 years ago
|
||
![]() |
||
Comment 3•7 years ago
|
||
@Jan Thanks for your reply!
@Jason Thanks for guidance. I'll try to look into this in the next few days.
Hello @Jan,
If this issue is still available, could it be assigned to me?
I would like to work on it.
Thanks!
Reporter | ||
Comment 6•7 years ago
•
|
||
(In reply to Neha from comment #5)
If this issue is still available, could it be assigned to me?
No activity in the last 3 months, so yes.
I would like to work on it.
It's yours, thanks for helping.
Honza
Hi @jlast, @honza,
I can see that the source is stored inside text
in line#183 and this is used to create the editor panel for the received source in line#238. We have to check here if text
has a pretty source and based on that we can show the Accessible Image for PrettyPrint from devtools/client/debugger/new/src/components/shared/
.
In the SourceTreeItem in Debugger, this check is done in line#278 in mapStateToProps()
with the checkHasPrettySource(state, source.id)
function. Can you please help me with these three questions:
- How we can use the
checkHasPrettySource(state, source.id)
function which comes from selectors for netmonitor responsetext
? I followed the calls as listed here:
- hasPrettySource() ->
- getPrettySource() ->
- getOriginalSourceByURL() ->
- getSpecificSourceByURL() ->
- getSpecificSourceByURLInSources() ->
- isOriginalSource() ,
but how to use the functions here is not clear.
-
In the
checkHasPrettySource(state, source.id)
in line#278, the source has an id property also, but the responsetext
in netmonitor does not seem to have one. -
There is also another file named
pretty-print-worker.js
indevtools/client/debugger/new/dist
alongsideparser-worker.js
. Should we use this directly or we use theparser-worker
file?
Also, could you please describe a bit more in detail how to create the parserWorkerService in the toolbox and how to pass in the debugger panel? The lines numbers in your comment seem to be pointing at different ones.
Thanks!
Comment 8•6 years ago
|
||
I just noticed that questions were asked here, but honza was not needinfo'd, so he likely did not see them. Let me set the flag so this bug shows up on his radar.
Reporter | ||
Comment 9•6 years ago
|
||
Jason, how could we share pretty printing with debugger - to pretty print HTTP JS responses in the Network's Response side panel?
Honza
![]() |
||
Comment 10•6 years ago
|
||
Hi Neha, sorry for the delay. Here is a sketch of what I would change patch
Notice how the pretty print worker is created in the toolbox so it can be shared with the debugger and net monitor :)
![]() |
||
Comment 11•6 years ago
|
||
Since this might change how the input is rendered into a text area, bug 1556114 could be a consideration for this planning.
Comment 12•6 years ago
|
||
Hi Neha, are you still interested in working on this bug? If not, please do let us know so it can be made available to others.
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Updated•3 years ago
|
Description
•