Windowless mode

The Equo Chromium browser provides a "Windowless" mode that is essentially a headless browser. The Equo Chromium Windowless mode is very useful for various operations regarding the processing of webpages, since it’s not configured with a GUI. As a result, it is much faster than a normal browser. This supports many use cases, such as:

  • Automated web testing

  • Data extraction or web scrapping

  • Layout checking and performance testing

  • Offscreen rendering

Using the Windowless mode in an SWT application

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;

import com.equo.chromium.ChromiumBrowser;

public class Windowless {
	public static void main(String[] args) throws ClassNotFoundException {
		ChromiumBrowser.earlyInit(); // (1)
		Display display = Display.getDefault();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));
		final ChromiumBrowser browser = ChromiumBrowser
				.windowless("https://docs.equo.dev/main/getting-started/introduction.html");
		Button button = new Button(shell, SWT.PUSH);
		button.setText("windowless");
		button.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				browser.executeJavacript("console.log(document.body.innerHTML)");
			}
		});

		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
You need to use [1] and property -Dchromium.init_threads=true or one of the methods described in Wayland Support section.

Using the Windowless mode in a plain Java application

import com.equo.chromium.ChromiumBrowser;

public class Windowless {
	public static void main(String[] args) {
		ChromiumBrowser browser = ChromiumBrowser
				.windowless("https://docs.equo.dev/main/getting-started/introduction.html");
		ChromiumBrowser.startBrowsers();
	}
}
The Windowless toolkit tries to integrate with the underlying system automatically (Standalone or SWT). The application can run without any display servers on Linux if it only creates Windowless browsers. To force it to integrate with SWT you can use the system property chromium.force_windowless_swt=true.