Chrome DevTools Protocol

CDP (Chrome DevTools Protocol) is a remote debugging protocol for browsers, for Chromium but also partially implemented in some other browsers like Firefox. Gluon uses CDP to control and talk to browsers, and also exposes a CDP API for raw CDP access. You should not have to use this, if there is something not implemented in Gluon’s API you have to use CDP for, please request it. See the CDP docs for more info.

send(method, params?, useSessionId = true)

Send a CDP command.



Method of CDP command to send.


Extra parameters of the CDP command to send.

Use Session ID

Whether to use the session id of the page or not, on by default. Set false for browser-level commands.

on(method, callback, once = false)

Hook into a specific CDP method being emitted. Returns a function to unhook (remove the listener).



Method of CDP event to hook into.


Callback function to run when the given method is emitted.


Unhook once the callback is called the first time, off by default.