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​

Query Parameters

    blockAds boolean
    blockAdsInclude string
    launch object
    profile string
    timeout number
    token string
    trackingId string
    allowedDomains string[]
    credentials object
    externalProxyServer string
    integrationId string
    proxy ProxyType

    Possible values: [datacenter, residential]

    proxyCity string
    proxyCountry string
    proxyLocaleMatch string

    Possible values: [0, 1, false, true]

    proxyPreset string
    proxyState string
    proxySticky string

    Possible values: [0, 1, false, true]

Body

    codestringrequired
    context object
    property name* ContextValue
    anyOf
  • Array [
  • circular(ContextValue)
  • ]

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")

Schema
    Was this page helpful?