$npx -y skills add dpearson2699/swift-ios-skills --skill browserenginekitBuild alternative browser engines using BrowserEngineKit. Use when developing a non-WebKit browser engine for iOS/iPadOS in supported regions, managing web content/rendering/networking extension processes, configuring GPU and networking process capabilities, checking alternative-
| 1 | # BrowserEngineKit |
| 2 | |
| 3 | Framework for building web browsers with alternative (non-WebKit) rendering |
| 4 | engines on iOS and iPadOS. Provides process isolation, XPC communication, |
| 5 | capability management, and system integration for browser apps that implement |
| 6 | their own HTML/CSS/JavaScript engine. Examples target Swift 6.3 and current |
| 7 | Apple SDKs. |
| 8 | |
| 9 | BrowserEngineKit is a specialized framework. Alternative browser engines are |
| 10 | available only through Apple-approved entitlement profiles and supported-region |
| 11 | device eligibility. EU support applies to eligible users on iOS 17.4+ and |
| 12 | iPadOS 18+; Japan support starts with iOS 26.2 and adds explicit PAC/MIE |
| 13 | security requirements for browser apps. Development and testing can occur |
| 14 | anywhere. The companion frameworks BrowserEngineCore (low-level primitives) and |
| 15 | BrowserKit (eligibility checks, data transfer) support the overall workflow. |
| 16 | |
| 17 | ## Contents |
| 18 | - [Overview and Eligibility](#overview-and-eligibility) |
| 19 | - [Entitlements](#entitlements) |
| 20 | - [Architecture](#architecture) |
| 21 | - [Process Management](#process-management) |
| 22 | - [Extension Types](#extension-types) |
| 23 | - [Capabilities](#capabilities) |
| 24 | - [Layer Hosting and View Coordination](#layer-hosting-and-view-coordination) |
| 25 | - [Text Interaction](#text-interaction) |
| 26 | - [Sandbox and Security](#sandbox-and-security) |
| 27 | - [Downloads](#downloads) |
| 28 | - [Common Mistakes](#common-mistakes) |
| 29 | - [Review Checklist](#review-checklist) |
| 30 | - [References](#references) |
| 31 | |
| 32 | ## Overview and Eligibility |
| 33 | |
| 34 | ### Eligibility Checking |
| 35 | |
| 36 | Use `BEAvailability` from the BrowserKit framework to check whether the device |
| 37 | is eligible for alternative browser engines. `BEAvailability` is available on |
| 38 | iOS/iPadOS 18.4+: |
| 39 | |
| 40 | ```swift |
| 41 | import BrowserKit |
| 42 | |
| 43 | do { |
| 44 | let eligible = try await BEAvailability.isEligible(for: .webBrowser) |
| 45 | guard eligible else { return /* fall back or explain */ } |
| 46 | // Device supports alternative browser engines |
| 47 | } catch { |
| 48 | // Handle eligibility lookup failure |
| 49 | } |
| 50 | ``` |
| 51 | |
| 52 | Eligibility depends on the device region and OS version. Do not hard-code |
| 53 | region checks; rely on the system API. |
| 54 | |
| 55 | Availability anchors: process APIs are iOS/iPadOS 17.4+, `BEDownloadMonitor` |
| 56 | is iOS 18.2+, `.revision2` restricted sandbox is iOS 26+, and |
| 57 | `RenderingExtensionFeature.coreML` is iOS 26.2+. |
| 58 | |
| 59 | ## Entitlements |
| 60 | |
| 61 | ### Browser App (Host) |
| 62 | |
| 63 | The host app requires two entitlements: |
| 64 | |
| 65 | | Entitlement | Purpose | |
| 66 | |---|---| |
| 67 | | `com.apple.developer.web-browser` | Enables default-browser candidacy | |
| 68 | | `com.apple.developer.web-browser-engine.host` | Enables alternative engine extensions | |
| 69 | |
| 70 | Both must be requested from Apple. The request process varies by region. |
| 71 | |
| 72 | ### Extension Entitlements |
| 73 | |
| 74 | Each extension target requires its type-specific entitlement set to `true`: |
| 75 | |
| 76 | | Extension Type | Entitlement | |
| 77 | |---|---| |
| 78 | | Web content | `com.apple.developer.web-browser-engine.webcontent` | |
| 79 | | Networking | `com.apple.developer.web-browser-engine.networking` | |
| 80 | | Rendering | `com.apple.developer.web-browser-engine.rendering` | |
| 81 | |
| 82 | ### Optional Entitlements |
| 83 | |
| 84 | | Entitlement | Extension | Purpose | |
| 85 | |---|---|---| |
| 86 | | `com.apple.security.cs.allow-jit` | Web content | JIT compilation of scripts | |
| 87 | | `com.apple.developer.kernel.extended-virtual-addressing` | Web content | Required alongside JIT | |
| 88 | | `com.apple.developer.memory.transfer_send` | Rendering | Send memory attribution; value is host app bundle ID | |
| 89 | | `com.apple.developer.memory.transfer_accept` | Web content | Accept memory attribution; value is host app bundle ID | |
| 90 | | `com.apple.developer.web-browser-engine.restrict.notifyd` | Web content | Restrict notification daemon access | |
| 91 | |
| 92 | ### Embedded Browser Engine (Non-Browser Apps) |
| 93 | |
| 94 | Apps that are not browsers but embed an alternative engine for in-app browsing |
| 95 | use different entitlements: |
| 96 | |
| 97 | | Entitlement | Purpose | |
| 98 | |---|---| |
| 99 | | `com.apple.developer.embedded-web-browser-engine` | Enable embedded engine | |
| 100 | | `com.apple.developer.embedded-web-browser-engine.engine-association` | Declare engine ownership | |
| 101 | |
| 102 | `engine-association` is available starting iOS/iPadOS/Mac Catalyst 26.2 and is |
| 103 | set to `first-party` when you own the engine or `third-party` when another |
| 104 | developer owns it. Embedded engines use `arm64` only (not `arm64e`), cannot |
| 105 | include browser extensions, and cannot use JIT compilation. |
| 106 | |
| 107 | ### Japan-Specific Requirements |
| 108 | |
| 109 | Browser apps distributed in Japan are supported on iOS 26.2+ and must adopt the |
| 110 | current security mitigations Apple lists for Japan, including Pointer |
| 111 | Authentication Codes and Memory Integrity Enforcement for relevant allocators |
| 112 | and extension processes. Enable hardware memory tagging with |
| 113 | `com.apple.security.hardened-process.checked-a |