Are getEventListeners supported for headless ?

217 views
Skip to first unread message

Srini Ananthakrishnan

unread,
Apr 10, 2018, 12:44:17 AM4/10/18
to headless-dev
Hi Team,
Are getEventListeners (e.g. click) supported for headless ? If yes, please provide some pointers how it can be used.
Also, is it possible to make is available to JS running on the page for plugins.

Thanks,
Srini

Eric Seckler

unread,
Apr 10, 2018, 2:19:51 AM4/10/18
to Srini Ananthakrishnan, headless-dev
On Tue, 10 Apr 2018, 05:44 Srini Ananthakrishnan, <srini...@gmail.com> wrote:
Hi Team,
Are getEventListeners (e.g. click) supported for headless ? If yes, please provide some pointers how it can be used.

DOMDebugger.getEventListeners should work. Documentation is in the protocol viewer [1], and we've pointed you to various examples of how to send DevTools commands before. Should be a piece of cake for you now :)


Also remember the advice on https://chromedevtools.github.io/devtools-protocol/ - sniffing the protocol goes a long way to understanding it.

If you're looking for example code, you might have more luck taking your question to stackoverflow.com.

Also, is it possible to make is available to JS running on the page for plugins.

You can use JS to gather the information you require [2]. Other than that, you could try running the DevTools command in your client and provide the relevant information back to the page e.g. via Runtime.evaluate. Your best option is using JS inside the page directly though as in [2].



Thanks,
Srini

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/4dc3d635-91a7-4fa0-b8d9-01f708e77736%40chromium.org.

Srini Ananthakrishnan

unread,
Apr 10, 2018, 11:35:33 AM4/10/18
to Eric Seckler, headless-dev
Thanks Eric for your great support.

Srini
Reply all
Reply to author
Forward
0 new messages