From browserless
Run custom Puppeteer code and capture files downloaded by Chrome during execution. Use when the user needs to download files from websites, export CSVs, grab PDFs, or programmatically trigger and retrieve any file download from a webpage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/browserless:downloadThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use the Browserless `/download` REST API to execute custom Puppeteer code and capture any files that Chrome downloads during execution.
Use the Browserless /download REST API to execute custom Puppeteer code and capture any files that Chrome downloads during execution.
The user's request is: "$ARGUMENTS"
Make a POST request to the Browserless download endpoint:
POST ${BROWSERLESS_API_URL}/download?token=${BROWSERLESS_TOKEN}
Content-Type: application/javascript
OR with JSON payload:
POST ${BROWSERLESS_API_URL}/download?token=${BROWSERLESS_TOKEN}
Content-Type: application/json
Before making the request, source the saved credentials and resolve the token:
source ~/.browserless/.env 2>/dev/null
The token is resolved in this order:
$BROWSERLESS_TOKEN environment variable (if already set in the shell)~/.browserless/.env file (written by /browserless:auth)/browserless:auth to configure their tokenFor the API URL, use $BROWSERLESS_API_URL if set, otherwise default to https://production-sfo.browserless.io.
Send raw JavaScript code directly. The function receives a page (Puppeteer Page) and optional context object. The code should trigger a file download — the API captures and returns the downloaded file.
export default async ({ page }) => {
await page.goto("https://example.com/reports");
const downloadButton = await page.waitForSelector("#download-csv");
await downloadButton.click();
};
{
"code": "export default async ({ page, context }) => { await page.goto(context.url); const btn = await page.waitForSelector('#download'); await btn.click(); };",
"context": {
"url": "https://example.com/reports"
}
}
Parameters:
code (string, required): ESM JavaScript code. Must export a default async function that receives { page, context } and triggers a file download.context (object, optional): Data passed into the function for dynamic behavior.The response contains the downloaded file as binary data with appropriate Content-Type and Content-Disposition headers matching the downloaded file.
Use curl via Bash to make the request. Save the output to a file using -o since the response is binary. Example:
source ~/.browserless/.env 2>/dev/null
curl -s -X POST "${BROWSERLESS_API_URL:-https://production-sfo.browserless.io}/download?token=$BROWSERLESS_TOKEN" \
-H "Content-Type: application/javascript" \
-o downloaded_file \
-d 'export default async ({ page }) => {
await page.goto("https://example.com/reports");
const btn = await page.waitForSelector("#download-csv");
await btn.click();
};'
Write the Puppeteer code based on the user's requirements. The code should navigate to the target page and trigger the download action (clicking a button, submitting a form, etc.). Always save the response to a file with -o since it's binary content. Use -D - or -i to inspect response headers if you need to determine the file type.
npx claudepluginhub browserless/claude-plugin --plugin browserlessGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.