Skip to content

Add experimental Safari Apple Events adapter - #781

Draft
tompulsarlabs wants to merge 1 commit into
browser-use:mainfrom
tompulsarlabs:contrib/safari-adapter
Draft

tompulsarlabs wants to merge 1 commit into
browser-use:mainfrom
tompulsarlabs:contrib/safari-adapter

Conversation

@tompulsarlabs

@tompulsarlabs tompulsarlabs commented Sep 9, 2026 •

Copy link
Copy Markdown

Safari cannot use the current CDP path. This proposes an optional macOS safari-harness package under adapters/safari for reading and interacting with existing Safari tabs through Apple Events. It provides familiar helper names, an agent skill, a disposable live fixture, and deterministic CI. The existing CDP runtime, package metadata, and skill are unchanged.

Opening as a draft for feedback on the separate-adapter approach before deeper integration. The contribution contains the adapter, tests, and concise documentation; the fork's project bookkeeping is outside this diff.

Validation

  • 15 adapter Python tests and 12 Node bridge tests passed in this contribution checkout.
  • All 268 upstream unit tests passed with the declared MCP extra installed.
  • Three prior controlled runs on Safari 26.6.2 passed exact form entry, one click, separate CLI reuse, synthetic session-marker checks, and selection-failure recovery. The runtime, skill, fixture, and tests here are byte-identical to the verified source. Recorded live evidence with source hashes.

Experimental limitations

Failed selection clears the previous target. Page JS also checks the exact URL before evaluating the requested expression, with executable Node regressions for redirects between validation and execution. That guard does not establish stable document identity: same-URL/title replacement, opaque origins sharing a URL, and native navigation races remain unresolved. Live adversarial race protection and agent/model-quality evaluations are unverified; consequential unattended writes remain outside the verified scope.

The adapter reports permission requirements, collects no recordings, and does not change Safari settings. Its README documents unsupported capabilities and opt-in live-test instructions.


Summary by cubic

Safari doesn't implement Chrome CDP, so this adds an optional safari-harness package under adapters/safari that controls existing Safari tabs through macOS Apple Events. The existing CDP runtime, package metadata, and skill are unchanged; this is a draft to gather feedback on the separate-adapter approach.

Experimental limitations

  • A failed selection clears the previous target, so re-list and select before another page action.
  • Page JS checks the exact URL before evaluating, but that does not establish stable document identity; same-URL/title replacement, opaque origins, and native navigation races remain unresolved.
  • Live adversarial race protection and agent/model-quality evaluations are unverified, so consequential unattended writes stay outside the verified scope.
  • The adapter reports permission requirements, collects no recordings, and does not change Safari settings.

Validation

  • 15 Python and 12 Node tests pass without a browser.
  • All 268 upstream tests pass with the declared MCP extra installed.
  • Three controlled runs on Safari 26.6.2 passed exact form entry, one click, separate CLI reuse, session markers, and selection-failure recovery.

Written for commit 87b62ff. Summary will update on new commits.

Review in cubic

@MagMueller

Copy link
Copy Markdown
Contributor

is keeping your existing Safari logins the main reason you built this?

@tompulsarlabs

Copy link
Copy Markdown
Author

is keeping your existing Safari logins the main reason you built this?

Yeah and I tend to use Safari and Chrome equally.

This branch has not been deployed

No deployments
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.

2 participants