How do you expand all objects in the console view of chrome?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 11:50:21

问题


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:


  1. Switch devtools to detached/floating window by clicking its Settings button, dock side: undock.
  2. Press Ctrl-Shift-i inside the devtools window to open devtools for the devtools.
  3. Paste and execute the following code in the newly opened devtools window:

    $$('.console-view-object-properties-section').forEach(e => e._section._objectTreeElement.expandRecursively())

  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!