Chrome DevTools Java Client


Chrome DevTools Java Client is a DevTools client - in Java. (: It can be used for instrumenting, inspecting, debuging and profiling Chromium, Chrome and other Blink-based browsers. [1]

For more information on DevTools, see

v1.3.6 tested on Google Chrome Version 67.0.3396.87. Protocol files from dev-tools-protocol#1aa7b31ca7

v2.0.0 tested on Google Chrome Version 76.0.3809.100. Protocol files from dev-tools-protocol#e1fb93bd76



Add the following dependency to your pom.xml:


You can use following code, taken from, LogRequestsExample:

package com.github.kklisura.cdt.examples;

import com.github.kklisura.cdt.launch.ChromeLauncher;
import com.github.kklisura.cdt.protocol.commands.Network;
import com.github.kklisura.cdt.protocol.commands.Page;

 * Log requests example with DevTools java client.
 * <p>The following example will open chrome, create a tab with about:blank url, subscribe to
 * requestWillBeSent event and then navigate to
 * @author Kenan Klisura
public class LogRequestsExample {
  public static void main(String[] args) {
    // Create chrome launcher.
    final ChromeLauncher launcher = new ChromeLauncher();

    // Launch chrome either as headless (true) or regular (false).
    final ChromeService chromeService = launcher.launch(false);

    // Create empty tab ie about:blank.
    final ChromeTab tab = chromeService.createTab();

    // Get DevTools service to this tab
    final ChromeDevToolsService devToolsService = chromeService.createDevToolsService(tab);

    // Get individual commands
    final Page page = devToolsService.getPage();
    final Network network = devToolsService.getNetwork();

    // Log requests with onRequestWillBeSent event handler.
        event ->
                "request: %s %s%s",

        event -> {
          // Close the tab and close the browser when loading finishes.

    // Enable network events.

    // Navigate to


For more examples, see examples.


API hangs (ie when printing PDFs)

What: If you're using cdt-java-client before version 2.1.0 for printing to PDF or using API which requests large amount of data, API may hang if the requesting data exceeds 4MB.

Why: This is due to underlying WebSocket library having 4MB buffer for receiving data from browser.

How to fix: With the version 2.1.0 and above, this buffer was increased to 8MB and can be further increased if necessary by setting the appropriate configuration property.

Running unit tests

make verify

Sonar analysis

make sonar-analysis

Download latest protocol

Run following:

make download-latest-protocol

This will download browser_protocol.json and js_protocol.json (protocol definitions) from repo.

Update protocol (generate Java files from protocol definitions)

Make sure you have correct or latest protocol definitions. See Download latest protocol on how to update protocol definitions to latest version.

Run following:

make update-protocol

This will build the tools for parsing and generating Java files, cdt-java-protocol-builder project. The input for this tool are protocol definitions files: browser_protocol.json and js_protocol.json. The generated Java files will be present in cdt-java-client project. After building Java files, the cdt-java-client will be compiled. If everything goes successfully, consider the protocol updated. :)


Chrome DevTools Java Client is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.