Repository navigation
Conversation
- Introduced `setup-browser-macos.sh` for installing Playwright and Chromium. - Updated `_use_browser_runtime` to ensure Playwright is importable in the packaged app. - Enhanced error handling in `_BrowserController` to guide users on installation. - Added tests for runtime integration and error handling.
Intel Macs. The script now asks for macosx_12_0_<arch> packages on both Intel and Apple Silicon. With the old setting, Intel Macs couldn't find a matching greenlet package and the install failed. A test download for Intel now succeeds. Older macOS. The script now stops on macOS 12 or 13 with: "The browser tools need macOS 14 or later (this Mac runs 13.6). The rest of OpenWorker works without them." I tested this by making the script believe it was on 13.6. The README now says "macOS 14 or later". Playwright updates. The script now reads the Python version from the installed app (…/_internal/python3.12), so a future app on a newer Python gets matching packages. If no app is found, it assumes 3.12, as before. On a reinstall it now ends with "Quit and reopen OpenWorker". A running app keeps the old Playwright loaded, which clashes with the new download. Error message. "requires Playwright" now only appears when Playwright is actually missing. If Playwright is there but Chromium won't start, the tool says "The browser could not start…" with the details. A test covers this.
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.
Browser tools: one-time setup script for the macOS app
Fixes #718. Refs #413 (same problem on Windows, not covered here).
Problem
The macOS app doesn't include Playwright, and its bundled Python ignores anything installed outside the app. So every
browser_*tool fails, and the error'spip install playwrightadvice can't help.Fix
Instead of bundling Playwright and Chromium, which would make the app much bigger, users opt in once:
packaging/setup-browser-macos.shinstalls Playwright 1.63.0, built for the app's own Python, plus Chromium into~/.config/coworker/browser-runtime/(about 700 MB).--uninstallremoves it.macosx_12_0wheels, the app's minimum).browser_automation.pyandtools.pylook in that folder before importing Playwright. Nothing is written insideOpenWorker.app, so the signature stays intact.pip install.Testing
tests/test_browser_runtime_setup.py, plus the existing browser, connector and catalog tests (184 passed)pip downloadbrowser_open_urlandbrowser_read_pagework on example.com through the installed folderbuild_dmg.sh) tested in a real sessionRelated
#396 and #361 replace the browser tools entirely. This is the minimal fix without growing the app, and becomes unnecessary if either lands. #564 touches the same
_BrowserController.page().🤖 Generated with Claude Code