For AI agents: a documentation index is available at /llms.txt
Skip to main content

/chromium/function

POST 

/chromium/function

Executes a Puppeteer or Playwright script in the browser context and returns the result. Browserless sets up a blank page, injects your puppeteer code, and runs it. You can optionally load external libraries via the "import" module that are meant for browser usage. Values returned from the function are checked and an appropriate content-type and response is sent back to your HTTP call.

Note: Also available at /function as a convenience alias.

Request

Responses

Responses are determined by the returned value of the function itself. Binary responses (PDF's, screenshots) are returned back as binary data, and primitive JavaScript values are returned back by type (HTML data is "text/html", Objects are "application/json")