Browserless listens for both incoming websocket requests, generally issued by most libraries, as well as pre-build REST APIs to do common functions (PDF generation, images and so on). When a websocket connects to Browserless it starts Chrome and proxies your request into it. Once the session is done then it closes and awaits for more connections. Some libraries use Chrome's HTTP endpoints, like /json to inspect debug-able targets, which Browserless also supports.
You still execute the script itself which gives you total control over what library you want to choose and when to do upgrades. This also comes with the benefit of keep your code proprietary and able to run on numerous platforms. We simply take care of all the browser-aspects and offer a management layer on top of the browser.
Tip
See more options on our full documentation site.
docker run -p 3000:3000 ghcr.io/browserless/chromium- Visit
http://localhost:3000/docsto see the documentation site. - See more at our docker package.
We offer a first-class hosted product located here. Alternatively you can host this image on just about any major platform that offers hosting for docker. Our hosted service takes care of all the machine provisioning, notifications, dashboards and monitoring plus more:
- Easily upgrade and toggle between versions at the press of a button. No managing repositories and other code artifacts.
- Never need to update or pull anything from docker. There's literally zero software to install to get started.
- Scale your consumption up or down with different plans. We support up to thousands of concurrent sessions at a given time.
If you're interested in using this image for commercial aspects, then please read the below section on licensing.
Puppeteer allows you to specify a remote location for chrome via the browserWSEndpoint option. Setting this for Browserless is a single line of code change.
Before
const browser = await puppeteer.launch();After
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://localhost:3000",
});We support running with playwright via their browser's remote connection protocols interface out of the box. Just make sure that your Docker image, playwright browser type and endpoint match:
Before
import pw from "playwright";
const browser = await pw.firefox.launch();After
docker run -p 3000:3000 ghcr.io/browserless/firefox
# or ghcr.io/browserless/multi for all the browsersimport pw from "playwright-core";
const browser = await pw.firefox.connect("ws://localhost:3000/firefox/playwright");After that, the rest of your code remains the same with no other changes required.
Browserless comes with built-in extension capabilities, and allows for extending nearly any aspect of the system (for Version 2+). For more details on how to write your own routes, build docker images, and more, see our SDK README.md or simply run "npx @browserless.io/browserless create" in a terminal and follow the onscreen prompts.
You can install a first-party interactive debugger for Browserless, that makes writing scripts faster and interactive. You can take advantage of things like debugger; calls and the page's console output to see what's happening on the page while your script is running. All of the Chrome devtools are there at your disposal.
A small list of features includes:
- Running
debugger;andconsole.logcalls - Errors in the script are caught and show up in the console tab
- DOM inspection, watch network requests, and even see how the page is rendering
- Exporting you debugging script as a Node project
- Everything included in Chrome DevTools
Installing the debugger is as simple as running the install:debugger script after the project has been built. This way:
$ npm run build
$ npm run install:debugger #or npm install:devYou will then see the debugger url during the startup process.
---------------------------------------------------------
| browserless.io
| To read documentation and more, load in your browser:
|
| OpenAPI: http://localhost:3000/docs
| Full Documentation: https://docs.browserless.io/
| Debbuger: http://localhost:3000/debugger/?token=6R0W53R135510
---------------------------------------------------------
Most libraries allow you to specify a remote instance of Chrome to interact with. They are either looking for a websocket endpoint, a host and port, or some address. Browserless supports these by default, however if you're having issues please make an issue in this project and we'll try and work with the library authors to get them integrated with browserless. Please note that in V2 we no longer support selenium or webdriver integrations.
You can find a much larger list of supported libraries on our documentation site.
