Skip to content

feat(types): add Browser Run script binding methods - #8313

Merged
danlapid merged 1 commit into
cloudflare:mainfrom
blackmountainb:browser-run-script-types
Nov 13, 2026
Merged

danlapid merged 1 commit into
cloudflare:mainfrom
blackmountainb:browser-run-script-types

Conversation

@blackmountainb

Copy link
Copy Markdown
Contributor

Adds script() and scriptInSession() to the BrowserRun binding types, with BrowserRunScriptOptions, BrowserRunScriptSessionOptions, BrowserRunScriptLibrary and BrowserRunScriptSuccessResponse.

Both methods return a raw Response:

  • It is either a { success: true, result } JSON body or the script's binary or non-JSON output.
  • HTTP errors come back as a Response, not as a thrown error.
  • script() also returns the cf-browser-session-id and cf-browser-target-id headers, so the same session can be reused with scriptInSession().

This is a types-only change: no runtime code changes. Snapshots were regenerated with just generate-types.

Docs: https://developers.cloudflare.com/browser-run/

@blackmountainb
blackmountainb requested review from a team as code owners November 9, 2026 19:01
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@clanky-the-clanker

clanky-the-clanker Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

This pull request's reviews are posted as pull request reviews: see the review of 8208280c.

@jamesopstad

Copy link
Copy Markdown
Contributor

clanky review

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — This pull request only changes type declarations. The new types are well named and documented, the snapshots match the source, and I found no issues.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

This pull request only adds type declarations, so it changes nothing at runtime that could affect security.


📖 AGENTS.md: ✅ LGTM

This change needs no AGENTS.md updates.


📋 Code Quality: ✅ LGTM

The new types follow the naming and typing rules for types/defines/. The generated snapshots match the source definitions.


⚡ Performance: ✅ LGTM

This change only adds type declarations and the regenerated snapshots, so it has no runtime or performance impact.


📝 Documentation: ✅ LGTM

The JSDoc for the new methods and option types is clear and consistent with the pull request description.


Reviewed commit: 8208280c

@blackmountainb

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 10, 2026
@danlapid
danlapid merged commit 9d45989 into cloudflare:main Nov 13, 2026
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants