Copy variable from tab preview in Chrome Dev Tools browser

I am using Chrome Dev Tools and I am browsing the network bar to see the XHR response with the preview tab. I want to capture a specific object from a preview. But when I try to store as a global variable by right-clicking the preview object, the temporary variable created was null.

I find this rather strange, as the data is in memory (otherwise it was not displayed at all). Here is an example of a fairly large array of answers from which I am trying to get a specific object.

Developer Tools

To clarify, I can save the variable that appears in my console. But I can not save the variable from the preview area of โ€‹โ€‹the network tab. Is there any feature of Chrome Dev Tools that I am missing or am I forced to disconnect the recording of my XHR response and pull the object from there?

I would prefer not to add any console.log() or other breakpoints to my code to remove them later. Digging out a jarring raw JSON response is also impractical. I am using Chrome 47 on Windows 7.

+5
source share
1 answer

Maybe a little late, but you can go to the answers tab, copy the contents of the response, and then in the console just paste it after:

 var response = <<paste here>> 

I canโ€™t say in the screenshot, but you can type response.data[64]

+1
source

Source: https://habr.com/ru/post/1239495/


All Articles