feat(safari): port the FSB extension to Safari via a native macOS wrapper - #145
Open
LakshmanTurlapati wants to merge 5 commits into
Open
LakshmanTurlapati wants to merge 5 commits into
LakshmanTurlapati wants to merge 5 commits into
Conversation
…pper Add a Safari Web Extension target (safari/FSB Xcode project with a Swift app, extension handler, and native MCP bridge) plus build/release/version scripts. The extension gains a platform adapter that degrades CDP-only features (pointer, keyboard, network capture, file upload) to content-script fallbacks, and a native-messaging MCP transport used in place of the WebSocket bridge. Font Awesome moves to assets/vendor, and the Chrome-only offscreen STT page is removed. New tests cover the adapter, native transport, manifest build, and source/version parity.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Refresh the generated date stamps in llms.txt, llms-full.txt, and sitemap.xml produced by build-crawler-files.mjs.
… roots - Give the content tab its own session key with a single writer so a page closing the workspace no longer overwrites the worker's tab id, and run tab/window listeners after hydration so an evicted worker doesn't write empty ids over the saved record. - Release the native read handle on every non-drained exit (throw, not-ok chunk, host that never marks the last chunk) instead of pinning it until the host TTL. - Store granted-root bookmarks in a file in the App Group container rather than a UserDefaults suite, whose per-process cache hid a fresh grant from a running extension until Safari quit.
Carry the Safari port onto main's hardened bridge. Main now classifies upgrades by Origin: only chrome-extension:// origins can be the extension, and an Origin-less socket must say relay:hello or be closed. That rejected both Safari transports, so: - bridge.ts accepts safari-web-extension:// origins alongside chrome-extension://, keeping main's host, pairing and pinning checks. - The native transport sends the extension origin in its open frame and the container app dials :7225 with it as the Origin header, instead of relying on the removed "no Origin means allowed" branch. - The bridge client keeps main's pairing subprotocols on the direct socket; the native socket connects unpaired. Other conflicts: - sidepanel.js: main's tab-surface sync and ownership refresh now resolve the target tab through getTargetTabs so Safari's workspace window is never mistaken for the content tab. - Safari build: nativeMessaging is in the Chrome manifest now, so it is classified as kept; capture_screenshot is declared as having no DOM fallback; the importScripts pins move to main's 333/329. - Rolled main's sidepanel and onboarding hash pins for the Safari edits and kept the native-free bridge-client check by rewording a comment.
…old-cache tabs
upload_file on Safari sent domSetFileInput straight to the tab, so a tab
whose content script was not loaded yet (freshly opened or reloaded) failed
with "Receiving end does not exist". It now runs ensureContentScriptInjected
first and targets frameId 0. It deliberately does not use
sendMessageWithRetry: a retry after a lost reply would set the file twice
and fire change twice, a double upload on auto-upload inputs.
resolveTargetTab fell back to an unscoped tabs.query({active:true}) when no
content tab was cached, which returns every window's active tab in no
particular order. It now asks windows.getLastFocused({windowTypes:['normal']})
first (the workspace is a popup window, so it is excluded), and keeps the old
query as the fallback when that API is missing, rejects, or returns the
workspace anyway.
This branch has not been deployed
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.
Adds a Safari Web Extension port: a new
safari/FSBXcode project (Swift app, extension handler, native MCP socket bridge, granted-roots file reader) plusbuild-safari,release-safari, andsync-safari-versionscripts, with esbuild andvalidate-extensionupdated to build and check the Safari bundle. The extension gets aplatform-adapterthat degrades CDP-only features (pointer, keyboard, network capture, file upload) to content-script fallbacks, and a native-messaging MCP transport used instead of the WebSocket bridge in Safari. Font Awesome moves toextension/assets/vendor(woff2 only), and the Chrome-only offscreen STT page is removed. New tests cover the adapter, native transport, CDP-degradation routing, pointer fallbacks, Safari manifest build, and source/version parity; the plan is in.planning/SAFARI-PORT-PLAN.md.