SFSafariViewController and Safari Data Sharing on iOS
Yes, SFSafariViewController on iOS shares AutoFill data,
Reader View preferences, and Content Blockers directly with the main
Safari web browser app. This article explains how these three core
features integrate between in-app browsing sessions and the native
Safari application, providing users with a consistent, secure, and
familiar web experience without ever needing to leave the host app.
AutoFill Data Sharing
SFSafariViewController has full access to a user's
Safari AutoFill data. When a user encounters a login screen,
registration page, or checkout form within an app using
SFSafariViewController, they can automatically populate
their information just as they would in the main Safari app.
This shared AutoFill data includes:
- Saved Passwords: Credentials stored in the iCloud Keychain are readily available for quick sign-ins.
- Credit Cards: Saved payment methods can be used for seamless in-app web purchases.
- Contact Information: Names, addresses, emails, and phone numbers can be filled in with a single tap.
For security reasons, SFSafariViewController runs in a
separate process from the host application. This means that while the
user can utilize their Safari AutoFill data inside the view controller,
the third-party app hosting it cannot read, intercept, or access that
sensitive information.
Reader View Preferences
The clutter-free Reader View available in the main Safari app is
fully supported in SFSafariViewController. When a user
opens a compatible article, they can tap the Reader button in the
address bar to strip away advertisements, navigation bars, and other
distractions.
The integration includes the following capabilities:
- Visual Preferences: Any adjustments the user makes
to the background color, font style, or text size within Reader View are
shared and remembered across both Safari and
SFSafariViewController. - Automatic Activation: App developers can configure
SFSafariViewControllerto automatically enter Reader View if the web page supports it, using theentersReaderIfAvailableconfiguration property.
Content Blockers
Content Blockers—such as ad blockers, tracker blockers, and privacy
extensions—that a user has installed and enabled for Safari in the iOS
Settings app are automatically applied to
SFSafariViewController.
Users do not need to configure these extensions separately for
individual apps. If a Content Blocker is active in the main Safari
browser, it will filter out unwanted content, scripts, and images in the
exact same way when browsing the web through
SFSafariViewController. Developers cannot disable a user's
Content Blockers within this view controller, ensuring the user's
privacy and browsing preferences are strictly respected.