问题
Is there a short cut for me to expand all these objects? I have attached a photo of what i would like to expand below. Any help would be amazing.
回答1:
- Switch devtools to detached/floating window by clicking its Settings button, dock side: undock.
- Press Ctrl-Shift-i inside the devtools window to open devtools for the devtools.
Paste and execute the following code in the newly opened devtools window:
$$('.console-view-object-properties-section').forEach(e => e._section._objectTreeElement.expandRecursively())
Switch to the original devtools window.
You may want to save the code as a snippet in Sources panel to quickly execute it later.
Based on chromium source code for the devtools.
回答2:
It looks like all of these are logging the same object. This won't be useful to expand everything.
When you expand an object in the console, it shows you the object at that point in time, not the time it was logged. You should literally log the values you want to verify.
What exactly are you trying to achieve by debugging in this manner? There is probably a more efficient way.
来源:https://stackoverflow.com/questions/40117840/how-do-you-expand-all-objects-in-the-console-view-of-chrome