[Question] Is it possible to return a subset of the values in the devtools protocol?

12 views
Skip to first unread message

Vedant Roy

unread,
Jul 6, 2023, 3:58:44 PM7/6/23
to Chrome DevTools
Some of the devtools protocol APIs return a very large amount of information. For example: `https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getMatchedStylesForNode`.

I was wondering, is it possible to get the devtools protocol to return a subset of this information, since my application might not need all of it?

Best,
Ved

Andrey Kosyakov

unread,
Jul 6, 2023, 5:04:40 PM7/6/23
to google-chrome-...@googlegroups.com
Hi Vedant,

There's no generic way in the protocol to limit or filter what a command returns. Some commands explicitly have parameters that specify how much to return, but getMatchedStylesForNode does not currently provide any way to limit the output.

Not sure what your use case or requirements are, but just in case you were looking for some way to get a large number of elements along with their computed style, DOMSnapshot.captureSnapshot may be helpful.

Best regards,
Andrey.

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/0939a851-59bb-41e8-bc5a-aa1c4cc585fan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages