Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save the results produced by Chrome DevTools' queryObjects()

Chrome DevTools has a console feature called queryObjects that lets you find all the objects with a particular constructor; e.g.

queryObjects(Promise)

However, it seems to only display the objects, not return them. This means that I can't write, say,

queryObjects(MyCustomType)[4].getName()

Is there a way to do this?

I am using Chrome 67.0.3396.87

like image 846
Charles Anderson Avatar asked Oct 17 '25 09:10

Charles Anderson


1 Answers

Once you've run the queryObjects(MyCustomType) command you can right-click on the resulting Array(XX) in the console and select "Store As Global Variable". It'd be better if you could just do let myThings = queryObjects(MyCustomType);.

like image 81
Derek Avatar answered Oct 18 '25 23:10

Derek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!