BrowserEngineKit
Create a browser that renders content using an alternative browser engine.
Overview
A web browser loads content and code from remote — and potentially untrusted — servers. Design your browser app to isolate access to system resources, the data of the person using the app, and untrusted data from the web. Code defensively to reduce the risk posed by vulnerabilities in your browser code.
If you use WKWebView to render web content in your browser app, WebKit automatically distributes its work to extensions that isolate their access to important resources and data.
Whether you use WebKit or write your own alternative browser engine, you need to:
Request the entitlement to act as a person’s default web browser. For more information, see Preparing your app to be the default web browser.
Watch for the MarketplaceKitURIScheme within web content to support alternative distribution apps that install from a website. For more information, see Enabling alternative distribution app installation in a browser.
Build a multi-process browser
If you use an alternative browser engine in your app, you must design your secure browser infrastructure to separate different components into extensions that your browser manages. Design a limited inter-process communication (IPC) protocol that coordinates work across the extensions. Separating your alternative browser engine into distinct extensions limits the impact of security vulnerabilities in any one process.
For more information on designing your browser extensions, see Designing your browser architecture. For information on using the extensions in your browser, see Managing the browser extension life cycle.
Render websites
Your browser app can get significant benefits by integrating closely with UIKit. You can customize the way your app handles many low-level user interface events, ensure that your browser app correctly renders CSS, and that it properly manipulates the Javascript DOM. You can use view classes in BrowserEngineKit to handle scrolling, drag interactions, and the context menu in your browser app.
For information on integrating a custom text view with the UIKit text system, see Integrating custom browser text views with UIKit.
In your browser app, launch extensions as the person browses web content to make network requests, load the web content, and render media. For more information, see Managing the browser extension life cycle. Use XPC to communicate between your browser app and extension processes. For more information, see Using XPC to communicate with browser extensions.
Develop by region
To distribute an app that uses an alternative browser engine, request the relevant entitlements for your developer account. You must also request an entitlement if your app isn’t a web browser but embeds an alternative browser engine for in-app browsing.
Support for alternative browser engines varies by geographic region:
- European Union
To request the entitlements in the EU for an iOS or iPadOS app, see Using alternative browser engines in the European Union.
- Japan
To request the entitlements in Japan for an iOS app, see Using alternative browser engines in Japan. Also, your app needs to adopt the com.apple.security.hardened-process.checked-allocations entitlement. In apps that aren’t browsers, you can embed only an alternative browser engine of which you have ownership; for more information, see Embedded Browser Engine Association Entitlement.
Topics
Essentials
Developing a browser app that uses an alternative browser engineDesigning your browser architecturePreparing your app to be the default web browser
Browser extensions
Web content
Scroll view interaction
Drag interaction
Context menus
Accessibility
BEAccessibilityTextMarkerSupportvalueChangedNotificationselectionChangedNotificationBEAccessibilityContainerTypeBEAccessibilityPressedStatemenuItempopUpButtonradioButtonreadOnlyvisitedBEAccessibilityRemoteElementBEAccessibilityRemoteHostElementBEAccessibility
Just-in-time code compilation
Protecting code compiled just in timeImproving control flow integrity with pointer authenticationBE_JIT_WRITE_PROTECT_TAG