WKWebExtension API, providing compatibility with Chrome/Firefox extensions while leveraging macOS’s built-in extension framework.
System requirements
Extension support requires:- macOS 15.5+ (for content script world isolation)
- macOS 15.4+ (basic extension support)
ExtensionUtils.isExtensionSupportAvailable.
Manifest versions
Nook supports both Manifest V2 and V3 extensions:Manifest V3
Preferred format with service worker backgrounds
Manifest V2
Legacy format with automatic
scripting permission injectionManifest V3 requirements
For MV3 extensions, your manifest must include a service worker:manifest.json
validateMV3Requirements().
Creating your first extension
Create the manifest
Start with a basic
manifest.json file:manifest.json
Required fields:
manifest_version, name, version. Validation happens in ExtensionUtils.validateManifest().Add popup JavaScript
popup.js
Use
browser namespace (Firefox style) or chrome namespace (Chrome style). Nook supports both.Installation flow
When you install an extension, Nook performs these steps automatically:Extension installation code is in
ExtensionManager.swift:1467 (performInstallation).Installation locations
- Extension packages:
~/Library/Application Support/Nook/Extensions/{extensionId}/ - Native messaging hosts:
~/Library/Application Support/Nook/NativeMessagingHosts/
Permission model
Nook uses an install-time permission grant model (Chrome-style):Runtime permissions
Foroptional_permissions, users see a permission dialog when your extension calls browser.permissions.request():
background.js
Background service workers
Nook loads background service workers immediately after installation:background.js
Background health is automatically probed at +3s and +8s via
probeBackgroundHealth() to detect initialization issues.Next steps
Manifest reference
Deep dive into manifest structure and WebKit-specific patching
API reference
Explore available browser APIs and native messaging
Debugging
Learn debugging tools and diagnostic utilities