Conversation
馃 Changeset detectedLatest commit: fac6026 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Thanks for your interest in Cloudflare Computer. This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:
If a maintainer asked you to open this pull request, they can add the |
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 17, 2026 15:33
d14c26a to
21a34da
Compare
commit: |
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 17, 2026 15:42
21a34da to
6aaabd9
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 17, 2026 17:04
6aaabd9 to
7951b3d
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 17, 2026 18:02
7951b3d to
27c19b1
Compare
Collaborator
|
This is awesome, I'd love to keep worker shell backend in similar parity with the js one. What do you think to adding a Where run.js is has a global browser instance: export default async ({ url, browser }) => {
const page = await browser.newPage();
await page.goto(url);
return { title: await page.title() };
}); |
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 21, 2026 10:11
27c19b1 to
44bb703
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 21, 2026 10:33
44bb703 to
4f0e944
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 21, 2026 10:47
4f0e944 to
00f8db1
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
2 times, most recently
from
September 21, 2026 11:20
5dc797e to
deb4e4e
Compare
| # packages/computer/src/backends/worker-shell/script/build-bundle.mjs on | ||
| # prepare / pretest / pretypecheck. | ||
| packages/computer/src/backends/worker-shell/generated/ | ||
| packages/computer/src/plugins/puppeteer/generated.ts |
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
2 times, most recently
from
September 21, 2026 11:43
35bb603 to
fb1f4e7
Compare
scuffi
force-pushed
the
computer/puppeteer-plugin
branch
from
September 21, 2026 13:15
fb1f4e7 to
fac6026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a public Puppeteer plugin for Computer's Worker JavaScript backend. The plugin bundles Cloudflare's Worker-compatible Puppeteer client, connects it to a Browser Run binding, and keeps
BrowserandPageobjects inside each isolated execution.It exposes bound
launch()andwithBrowser()helpers, keeps plugin bindings separate from caller environment values, and closes connection-bound browser sessions when work completes or an execution is disposed.The worker shell reaches the same capability through an opt-in
browsercommand, so a browser task is available from a command line as well as from a module.Usage
Register the plugin on the backend, then import Puppeteer from code executed by Computer:
Shell usage
Add the command group to a worker shell backend in the same Workspace:
A task module is an ordinary module whose default export receives a live browser alongside the caller's input:
browser puppeteer --url https://example.com/ tasks/title.js browser puppeteer --url https://example.com/ --stdin < tasks/title.jsThe shell does not drive the browser itself. The command resolves the task from the Workspace, wraps it in the same
withBrowser()entry shown above, and dispatches that entry into the JavaScript backend carrying the plugin, so Puppeteer stays in the isolate. It prints the task's return value as JSON and exits with the task's exit code.--timeoutsets the execution budget,--inputmerges a JSON object into the task input, and a--urlconfines the session to that host, its subdomains, and common content delivery networks.Because the task runs in the JavaScript backend, it can write to the Workspace through
node:fs/promises, so a stored task can be named, rerun, and edited, and its output outlives the execution that produced it.Browser rendering example
The new self-hosted example stores one browser task in the Workspace and runs it both ways, as a JavaScript module and as a shell command. Either path writes
report.md,page.json, andscreenshot.pngto one Workspace directory from a single isolated execution.The package and architecture documentation cover Browser Run setup, lifecycle, limits, plugin authoring, and the authority granted to browser-enabled backends.