packages/examples/browser-extension/safari/README.md
This directory contains instructions for building the Safari version of the Chat with Webpage extension.
Safari extensions are built using the same Web Extension APIs as Chrome, but they need to be wrapped in a native macOS/iOS app container. Apple provides a tool to convert Chrome extensions to Safari format.
npm run build in the chrome/ directory)cd ../chrome
npm install
npm run build
The Safari package prepares a Safari-safe extension source before calling Apple's xcrun safari-web-extension-converter. This keeps Chrome's manifest unchanged while removing Chrome-only permissions such as offscreen from the converter input.
# Navigate to the Safari wrapper directory
cd /path/to/examples/browser-extension/safari
# Prepare the Safari source and convert it to an Xcode project
npm run convert
This will create an Xcode project in the safari/ directory.
open safari/Chat\ with\ Webpage/Chat\ with\ Webpage.xcodeproj
During development, you can enable automatic reloading:
The same Xcode project can build for iOS:
Safari uses the browser namespace by default. The converter tool usually handles this, but if you see errors:
browser and chrome namespaces are compatible in SafariSafari requires explicit user permission for:
Users need to grant these in Safari Settings > Extensions.
safari/
└── Chat with Webpage/
├── Chat with Webpage.xcodeproj
├── iOS (App)/
│ └── ... iOS app wrapper files
├── macOS (App)/
│ └── ... macOS app wrapper files
└── Shared (Extension)/
├── manifest.json
├── Resources/
│ ├── background.js
│ ├── content.js
│ ├── popup.html
│ ├── popup.css
│ ├── popup.js
│ └── icons/
└── ... other extension files