Chrome Developer Tools Invoke Property Getter

后端 未结 3 1190
旧巷少年郎
旧巷少年郎 2021-02-05 07:38

All of my property values require me to click them in order to see them. How can I fix this?

The object I\'m trying to view is this Query Object. It seems to

3条回答
  •  耶瑟儿~
    2021-02-05 08:18

    You can work-around this, by running a script to auto-invoke the getters. To do this:

    1. Open DevTools in a separate window.
    2. Press CTRL+SHIFT+I
    3. Switch to the console tab (of the devtools inspecting devtools)
    4. Evaluate the below, and close the window
    setInterval(() => {
      [...document.querySelectorAll(".source-code")]
        .map(s => [
          ...(s.shadowRoot?.querySelectorAll(
            ".object-value-calculate-value-button"
          ) || [])
        ])
        .flat()
        .forEach(s => s.click());
    }, 500);
    

    This will search for the invoke property button every 500ms. and click it for you.

提交回复
热议问题