The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Safari compatibility of the browser collector
Researched 2026-09-23 against Apple's developer documentation, Apple Developer
Forums answers from Apple engineers, and MDN's browser-compat-data (the table
Apple's own docs point to). Nothing here has been run in Safari yet. Every
"supported" below means documented as supported. Each item names the manual
check in smoke-checklist.md that confirms it.
What the extension uses, and what Safari documents
Extension feature (from browser-extension/src/manifest.json and src/) |
Safari support | Source | Verify with |
|---|---|---|---|
| Manifest V3 | Safari 15.4+ supports MV2 and MV3 | Assessing browser compatibility | S1 |
background.service_worker |
Safari 15.4+ | BCD background | S2 |
background.scripts + preferred_environment (a fallback, if one is needed) |
scripts Safari 14+; preferred_environment Safari 18+ |
BCD background | only if S5 fails |
content_scripts[].world: "MAIN" (the interceptor depends on it) |
Safari 18+ | BCD content_scripts | S3 |
scripting.executeScript with world: "MAIN" (fallback if the manifest key misbehaves) |
Safari 15.4+ | BCD scripting | only if S3 fails |
scripting.registerContentScripts with world |
Safari 16.4+; an Apple engineer confirmed MAIN is supported there | BCD scripting, forum 728849 | only if S3 fails |
content_scripts[].run_at: "document_start" |
Safari 14+, but scripts are not injected until the user grants site access; later loads honour run_at |
BCD content_scripts | S3, S4 |
host_permissions |
Safari 15.4+, but not granted at install: the user grants each site (once, for a day, or always) from the toolbar, or in Safari Settings > Websites | Managing permissions | S4 |
web_accessible_resources object form (resources, matches) |
Safari 15.4+. use_dynamic_url is always effectively on |
BCD WAR | S3 |
options_page |
Safari 14+ | BCD options_page | S8 |
action.default_popup |
Safari 15.4+ | BCD action | S8 |
storage.local (durable delivery queue, settings) |
Supported; 5 MB limit unless unlimitedStorage |
Assessing browser compatibility | S7 |
alarms.create / alarms.onAlarm (delivery retry) |
Safari 14+ | BCD alarms | S7 |
runtime.sendMessage / onMessage / onInstalled / getPlatformInfo / id |
Safari 14+ | BCD runtime | S2, S5 |
chrome.* namespace (the source calls chrome.* directly) |
Supported. Safari exposes both chrome.* and browser.*, with callbacks and Promises |
Assessing browser compatibility | S1 |
Service-worker fetch POST to http://127.0.0.1:4318/v1/logs |
See "Reaching the collector" below | — | S5 |
Minimum Safari for the current manifest: 18, because of the MAIN-world content script. Safari 18 runs on macOS 13 Ventura and later.
Reaching the collector
The issue expected two macOS network gates to apply. Both look unlikely to apply, and a third gate, not in the issue, is the real risk.
- Local Network privacy prompt: not expected. TN3179 defines a
local network as an IP network on a broadcast-capable interface (Wi-Fi,
Ethernet); loopback is not one. It also says, in so many words, "Traffic
originating from WKWebView, SFSafariViewController, and Safari doesn't
require local network access." The extension's
fetchruns inside Safari, not in the wrapper app's process. - App Transport Security exception (
NSAllowsLocalNetworking): probably not needed. ATS governs the app's ownURLSessiontraffic. The extension's JavaScript runs in Safari's web and networking processes. Apple's Safari extension docs say nothing about ATS for extensionfetch. If S5 shows an ATS error in the service worker console, addNSAppTransportSecurity>NSAllowsLocalNetworking = YESto the extension target'sInfo.plistand retest. Do not add it to the app's. - CORS in the service worker: the real risk. Safari bypasses CORS for
background fetches only to hosts the extension has been granted
(forum 654839, Apple engineer). Host permissions start in "ask"
mode in Safari (Managing permissions). And there is a reported
Safari bug where the bypass works for background pages but not background
service workers (repro repo; the same forum thread suggests
background.scriptsas the workaround). The collector's OTLP/HTTP receiver has no CORS configuration. The POST sendscontent-type: application/json, which forces a preflight. So an ungranted or unbypassed request fails with "Fetch API cannot load http://127.0.0.1:4318/v1/logs due to access control checks", and nothing is captured. Mitigations, in order of preference:- Grant
127.0.0.1site access, either by the user or through MDMAllowedDomains(seemdm/). This is the first thing to try in S5. - If the service worker still fails once access is granted, ship a Safari
manifest variant with
background.scripts(pluspreferred_environment: ["document", "service_worker"]). The per-target build merged in #628 makes that a derived-manifest function on thesafarientry inbrowser-extension/tools/targets.mjs, which today ships the manifest unchanged. - Last resort: add a
cors.allowed_originsentry forsafari-web-extension://*to the collector's OTLP HTTP receiver. Safari changes the extension's origin UUID on every launch (forum 654839), so an exact origin cannot be pinned. A wildcard would let any Safari extension post to the collector, so treat this as a security change, not a packaging tweak.
- Grant
Gap list
Blocking. Must be confirmed on a Mac before Safari counts as supported:
- G1: collector reachability (S5). The CORS and host-grant behaviour above. If this fails, nothing is captured.
- G2: MAIN-world interceptor (S3). Documented for Safari 18, but not yet
observed teeing
window.fetchon claude.ai and chatgpt.com in Safari. - G3: site-access grants. Content scripts do not run on claude.ai or
chatgpt.com until the user grants access. Unmanaged users need an onboarding
step. The host-permission banner merged in #628 (
src/shared/permissions.ts, shown in the popup and options page) may cover that, since it asks throughpermissions.request. How Safari answers that call from an extension page has not been tested, so S4 must check it. Managed fleets can pre-grant with MDMAllowedDomains, but only on supervised macOS 15+ (seeREADME.md).
Non-blocking differences:
- G4: service-worker lifetime. Safari's MV3 background is non-persistent, like Chrome's. The in-memory assembler has the same mid-stream-suspension limitation the README already lists. Safari's idle timeout is not documented.
- G5: no
update_url. Apple says to deliver Safari extension updates through the App Store (Assessing browser compatibility). A Developer ID build updates only when a newer app is installed, by a package or by MDM. - G6: sites' streaming in WebKit. claude.ai and chatgpt.com may serve WebKit a different transport, such as XHR or a different SSE framing. The adapters are fixture-tested on Chromium captures only. Record a Safari fixture if S4 or S6 shows different traffic.
- G7: no automated in-browser test. Playwright cannot load extensions into
WebKit, and
safaridrivercannot install them. The replay e2e stays Chromium-only. Safari is covered by the unit tests, which are browser-agnostic, plus the manual checklist. - G8: browser identity. Safari events carry the same
claude_webandchatgpt_webharness names. The browser-identity attribute is #394's work.
Not needed for Safari:
- A
browser.*shim. Safari supportschrome.*natively. The shim merged in #628 (src/shared/browser.ts) prefersbrowser.*where it exists, which is harmless in Safari but not required. - The Local Network usage string (
NSLocalNetworkUsageDescription). See "Reaching the collector" above.
Sources
- Assessing your Safari web extension's browser compatibility
- Managing Safari web extension permissions
- Packaging a web extension for Safari
- Running your Safari web extension
- TN3179: Understanding local network privacy
- Safari 18 release notes: Device Management of extension state, private browsing, and website access
- MDN browser-compat-data: manifest
background, manifestcontent_scripts, manifestweb_accessible_resources, manifestoptions_page, manifestaction,scripting,alarms,runtime - Apple Developer Forums: world MAIN support (728849), background CORS (654839)
- Safari service-worker background CORS repro