开源 · 自托管 · Cloudflare Workers Open source · Self-hosted · Cloudflare Workers

让 Safari 书签
与 Chrome、Firefox 保持同步
Keep Safari bookmarks in sync
with Chrome and Firefox

以 Safari 为准:书签放在哪个文件夹、叫什么名字,都跟 Safari 一致。在任何一个浏览器里新增或删除书签,其他地方都会跟着变化,并经 iCloud 同步到你的 iPhone 和 iPad。 Safari is the source of truth: every bookmark's folder and title follow Safari. Add or delete a bookmark in any browser and the change reaches the others, and through iCloud your iPhone and iPad.

macOS 14 或更新版本 · Apple 芯片和 Intel · Chrome 116+ · Firefox 桌面版 macOS 14 or later · Apple silicon and Intel · Chrome 116+ · Firefox for desktop

功能Features

以 Safari 为准Safari decides

文件夹和标题都跟 Safari 一致。浏览器里已有的同网址书签会被移到对应位置,不会重复新建。 Folders and titles follow Safari. A matching bookmark already in a browser is moved into place, never duplicated.

双向同步Both directions

在 Chrome 或 Firefox 的 "Safari Bookmarks" 文件夹里新增的书签,会直接写入 Safari,Safari 开着也可以。 Bookmarks added to the "Safari Bookmarks" folder in Chrome or Firefox are written straight into Safari, even while it's open.

删除也同步Deletes sync too

任意一端删除,其他端跟着删除。一次删除很多时会先请你确认,防止误删。 Delete anywhere and it's gone everywhere. A large delete waits for your confirmation first.

到达 iCloudReaches iCloud

从浏览器同步回来的改动会经 iCloud 传到 iPhone、iPad 和其他 Mac,不用你手动打开 Safari。 Changes from your browsers travel through iCloud to your iPhone, iPad and other Macs, without you opening Safari.

你自己的服务器Your own server

服务端是部署在 Cloudflare 上的 Worker,免费额度足够个人使用。每个 Access Key 一个同步组,数据互相隔离。 The server is a Cloudflare Worker; the free plan covers personal use. Each Access Key has its own sync group, isolated from the others.

写入前先备份Backups first

Mac App 每次写入前备份 Safari 书签(保留最近 20 份);浏览器扩展第一次连接前备份整个书签树。 The Mac app backs up Safari's bookmarks before every write (the last 20 are kept); the extensions back up the whole bookmark tree before first connecting.

工作方式How it works

Mac 上的菜单栏 App 负责 Safari,浏览器扩展负责 Chrome 和 Firefox,它们都和你部署在 Cloudflare 上的 Worker 同步。有改动时,Worker 会通过 WebSocket 实时通知各端。 A menu bar app on the Mac looks after Safari and browser extensions look after Chrome and Firefox; all of them sync with your Worker on Cloudflare, which tells every device about changes in real time over WebSocket.

开始使用Get started

  1. 获取 Access KeyGet an Access Key

    每位用户一个 Access Key,对应一个独立的同步组。想试用的话请联系作者开通;也可以按 GitHub 上的说明把服务端部署到你自己的 Cloudflare 账号。 Each user has one Access Key and their own sync group. To try it, contact the author; or deploy the server to your own Cloudflare account by following the instructions on GitHub.

  2. 安装 Mac AppInstall the Mac app

    1. 从 GitHub 下载最新的 DMG,把 App 拖进"应用程序"。 Download the latest DMG from GitHub and drag the app into Applications.
    2. App 已签名但没有经过苹果公证,第一次打开会被拦截:macOS 15 及以上,到"系统设置 → 隐私与安全性"点"仍要打开";macOS 14,在 Finder 里右键点 App,选"打开"。 The app is signed but not notarized, so macOS blocks the first launch. On macOS 15 or later, open System Settings → Privacy & Security and click "Open Anyway"; on macOS 14, Control-click the app in Finder and choose Open.
    3. App 出现在菜单栏。在设置窗口的 "Sync Group" 页填入下面的 Worker 地址和你的 Access Key,点 "Connect"。 The app appears in the menu bar. On the "Sync Group" page of its settings, enter the Worker address below and your Access Key, then click "Connect".
    4. 在弹出的选择框里点 "Allow Access",允许 App 读取 Safari 书签。macOS 保护 Safari 文件夹,这一步只需做一次。 In the panel that opens, click "Allow Access" so the app can read Safari's bookmarks. macOS protects the Safari folder; this is needed only once.
    5. 第一次上传到 iCloud 时,macOS 会询问是否允许 App 控制 Safari,请点"允许"。 The first time it uploads to iCloud, macOS asks whether the app may control Safari; click Allow.
    Worker 地址Worker address 本页面的网址this page's address
    下载最新版本Download the latest version
  3. 从 GitHub 安装浏览器扩展Install the browser extensions from GitHub

    下载项目的 ZIP 并解压,扩展分别在 chrome-extension 和 firefox-extension 文件夹里。 Download the project as a ZIP and unzip it. The extensions are in the chrome-extension and firefox-extension folders.

    下载 ZIPDownload ZIP

    Chrome

    1. 在地址栏打开 chrome://extensions,开启右上角的"开发者模式"。 Open chrome://extensions in the address bar and turn on "Developer mode" at the top right.
    2. 点"加载已解压的扩展程序",选择 chrome-extension 文件夹。需要 Chrome 116 或更新版本。 Click "Load unpacked" and choose the chrome-extension folder. Requires Chrome 116 or later.

    Firefox

    1. 在地址栏打开 about:debugging#/runtime/this-firefox。 Open about:debugging#/runtime/this-firefox in the address bar.
    2. 点"临时载入附加组件",选择 firefox-extension 文件夹里的 manifest.json。 Click "Load Temporary Add-on" and choose manifest.json in the firefox-extension folder.

    这样载入的扩展在 Firefox 重启后会被移除,需要重新载入。 An add-on loaded this way is removed when Firefox restarts and has to be loaded again.

  4. 配对浏览器Pair your browsers

    1. 在 Mac App 的 "Sync Group" 页点 "Create Code",生成一个配对码(30 分钟内有效,只能用一次)。 On the Mac app's "Sync Group" page, click "Create Code" to get a pairing code (valid for 30 minutes, single use).
    2. 点浏览器里的扩展图标,填入 Worker 地址和配对码,点 "Connect"。扩展会先备份整个书签树再开始同步。 Click the extension's icon in the browser, enter the Worker address and the pairing code, and click "Connect". The extension backs up your whole bookmark tree before syncing.
    3. 同步的书签在浏览器的"其他书签 › Safari Bookmarks"文件夹里。每个浏览器各需要一个配对码。 Synced bookmarks live in "Other Bookmarks › Safari Bookmarks". Each browser needs its own pairing code.

常见问题FAQ

需要一直开着 Safari 吗? Does Safari have to stay open?

不需要。Mac App 在 Safari 开着或关着时都能写入书签。需要上传到 iCloud 时,它会在后台隐藏打开 Safari,传完再退出;你在这期间用了 Safari 就不会退出。不想让它打开 Safari,可以在设置里关掉 "Upload to iCloud in the background"。 No. The Mac app writes bookmarks whether Safari is open or not. When changes need to go to iCloud, it opens Safari hidden and quits it afterwards, unless you started using it in the meantime. To keep it from opening Safari, turn off "Upload to iCloud in the background" in its settings.

阅读列表里为什么有一条 "Safari Bookmarks Sync"? Why is there a "Safari Bookmarks Sync" item in my Reading List?

它用来启动 iCloud 上传。Safari 只会在自己保存一次改动后才上传到 iCloud,所以 App 让 Safari 重新添加这一条:已存在时 Safari 会替换它,不会重复。它不会同步到 Chrome 和 Firefox。Safari 添加这一条时会顺便打开阅读列表边栏。 It starts the iCloud upload. Safari uploads only after it saves a change of its own, so the app has Safari add this item again; Safari replaces an existing one, so there is never a duplicate. It is never synced to Chrome or Firefox. Safari also opens the Reading List sidebar when it adds the item.

一次删了很多书签会怎样? What if I delete a lot of bookmarks at once?

在 Safari 一次消失超过 20 条且超过 10% 的书签时,Mac App 会先请你确认;在浏览器里 10 分钟内删除同样多的书签时,它们会先被放回,扩展图标上出现红色 "!",在扩展弹窗里确认后才会在所有地方删除。 If more than 20 bookmarks (and more than 10%) disappear from Safari at once, the Mac app asks you first. If you delete that many in a browser within 10 minutes, they are put back and the extension icon shows a red "!"; they are deleted everywhere only after you confirm in the extension's popup.

我的数据存在哪里? Where is my data stored?

存在 Worker 上属于你这个同步组的 SQLite Durable Object 里,不同 Access Key 的数据互相隔离。删除记录保留 90 天后自动清理。Safari 书签的备份只存在你自己的 Mac 上。详见隐私政策。 In your sync group's own SQLite Durable Object on the Worker; data under different Access Keys is kept apart. Deleted entries are cleaned up after 90 days. Backups of Safari's bookmarks stay on your own Mac. See the privacy policy.

有哪些限制? What are the limitations?
  • 上传到 iCloud 依赖 Safari 书签文件的内部格式,不是苹果公开的接口,Safari 更新后可能失效。 Uploading to iCloud relies on the internal format of Safari's bookmarks file, not a public Apple interface, so a Safari update can break it.
  • Mac App 没有经过苹果公证,第一次打开需要手动允许。 The Mac app is not notarized, so you allow it by hand the first time.
  • 书签会放进正确的文件夹,但文件夹内的顺序不跟 Safari 保持一致。 Bookmarks land in the right folders, but the order inside a folder doesn't follow Safari.
  • 每个同步组只有一台 Mac 负责 Safari;Firefox 只支持桌面版。 One Mac per sync group looks after Safari; Firefox is supported on desktop only.

联系作者Contact the author

想试用、开通 Access Key,或者使用中遇到问题,都可以通过微信或邮箱联系作者。 To try it, ask for an Access Key, or report a problem, reach the author on WeChat or by email.

微信WeChat Itsuka_Sayonara
邮箱Email will.leng@ethtest.com