Skip to content

feat: Safari extension shell — save-only client (issue #26) - #79

Open
paperhurts wants to merge 2 commits into
mainfrom
feat/safari-extension
Open

feat: Safari extension shell — save-only client (issue #26)#79
paperhurts wants to merge 2 commits into
mainfrom
feat/safari-extension

Conversation

@paperhurts

Copy link
Copy Markdown
Owner

Summary

Adds @gitmarks/extension-safari, the last roadmap package (#26).

Load-bearing finding: Safari does not implement the browser.bookmarks WebExtension API at all (Apple dev forums 650614, 658034, 721635; MDN compat). Everything the background layer does in the Chrome/Firefox shells — bookmark listeners, cold-start reconcile, apply-remote, the 5-minute poll alarm — exists to sync the native tree, so none of it can run in Safari.

The Safari shell therefore ships no background at all and is a save-only client:

  • Save this page — the popup-direct save path never depended on the background, works unchanged
  • Save all tabstabs.query + on-demand optional tabs permission, both supported by Safari
  • Options — settings via browser.storage.local
  • Search/tags/bulk ops/trash/export happen in the web UI (linked from the popup footer)

What's in the package

Same thin-shell pattern as extension-firefox: MV3 manifest (no background key, no bookmarks/alarms permissions, CSP restricting connect-src to api.github.com), plain Vite build with popup+options entries only, copy-html/copy-manifest scripts, thin src/ re-exports from @gitmarks/extension-shared. scripts/gen-icons.mjs now also emits the safari icons dir.

What's NOT in this PR (macOS-only, still open on #26)

xcrun safari-web-extension-converter and Xcode don't run on Windows. The package README documents the full Mac-side flow: convert dist/ → build the wrapper app in Xcode → allow unsigned extensions → enable in Safari, plus signing options and a save-only smoke-test checklist. The generated xcode/ dir is git-ignored (derived output).

Test plan

  • pnpm -r typecheck — all packages pass
  • pnpm test — 311 tests pass (no new tests: the shell contains no logic; popup/options logic is covered by extension-shared's suite)
  • pnpm --filter @gitmarks/extension-safari builddist/ contains manifest (verified no background key), popup/options HTML+JS, icons
  • Manual smoke test on macOS after conversion (checklist in package README)

🤖 Generated with Claude Code

https://claude.ai/code/session_01A1P9F4m6dszYGDEfcPVMdj

paperhurts and others added 2 commits July 16, 2026 16:45
#26)

Safari does not implement the browser.bookmarks WebExtension API, so the
entire background layer (listeners, reconcile, apply-remote, poll alarm)
has nothing to do there. The Safari shell ships popup + options only:
Save this page, Save all tabs, and settings all work unchanged via
@gitmarks/extension-shared; management happens in the web UI.

- packages/extension-safari: MV3 manifest (no background, no
  bookmarks/alarms perms), plain Vite build with popup/options entries,
  copy-html/copy-manifest scripts, thin src re-exports
- scripts/gen-icons.mjs: add the safari icons dir
- README documents the macOS-only conversion
  (xcrun safari-web-extension-converter), signing options, and the
  save-only smoke test; generated xcode/ dir is git-ignored
- CLAUDE.md: project status + roadmap updated

Xcode conversion, signing, and the manual smoke test require macOS and
remain outstanding on issue #26.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1P9F4m6dszYGDEfcPVMdj
- README: install section, status, features caveat, packages table,
  architecture diagram, roadmap
- spec.md: amend goal, architecture diagram, and build-order item 10
  with the no-browser.bookmarks constraint (dated amendments, history
  kept)
- CLAUDE.md: shells section covers all three shells; also fixes the
  stale "own HTML files duplicated across shells" bullet (all shells
  copy HTML from extension-shared via copy-html.mjs)
- Chrome/Firefox READMEs: cross-reference the Safari shell

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1P9F4m6dszYGDEfcPVMdj
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.

1 participant