One Logo Pool Ball
WebKit · IOS API REFERENCE

WebPage.NavigationPreferences

struct · iOS 26.0+ · SDK 27.1

struct NavigationPreferences

A type that specifies the behaviors to use when loading and rendering page content. Create a `NavigationPreferences` value when you want to change the default rendering behavior of your web page. Typically, iOS devices render web content for a mobile experience, and Mac devices render content for a desktop experience.

Members (19)

get · iOS 27.0+

allowsJSHandleCreationInPageWorld

TypeScript
get allowsJSHandleCreationInPageWorld(): Promise<boolean>
Swift declaration
var allowsJSHandleCreationInPageWorld: Bool

Indicates whether `window.webkit.createJSHandle` will be available in `WKContentWorld.page` The default value of this property is `false`.

set · iOS 27.0+

allowsJSHandleCreationInPageWorld

TypeScript
setAllowsJSHandleCreationInPageWorld(value: boolean): Promise<void>
Swift declaration
var allowsJSHandleCreationInPageWorld: Bool

Indicates whether `window.webkit.createJSHandle` will be available in `WKContentWorld.page` The default value of this property is `false`.

get · iOS 27.0+

alternateRequest

TypeScript
get alternateRequest(): Promise<(_Foundation_URLRequest) | null>
Swift declaration
var alternateRequest: URLRequest?

Used to make changes to the network request that will be used for this navigation's main resource load.

set · iOS 27.0+

alternateRequest

TypeScript
setAlternateRequest(value?: (_Foundation_URLRequest) | null): Promise<void>
Swift declaration
var alternateRequest: URLRequest?

Used to make changes to the network request that will be used for this navigation's main resource load.

get · iOS 27.0+

overrideReferrer

TypeScript
get overrideReferrer(): Promise<(string) | null>
Swift declaration
var overrideReferrer: String?

Used to apply a custom `referer` header to all resource loads in the frame of this navigation.

set · iOS 27.0+

overrideReferrer

TypeScript
setOverrideReferrer(value?: (string) | null): Promise<void>
Swift declaration
var overrideReferrer: String?

Used to apply a custom `referer` header to all resource loads in the frame of this navigation.

get · iOS 26.0+

preferredContentMode

TypeScript
get preferredContentMode(): Promise<WebPage_NavigationPreferences_ContentMode>
Swift declaration
var preferredContentMode: WebPage.NavigationPreferences.ContentMode

The content mode for the web view to use when it loads and renders a webpage. The default value of this property is `recommended`. The web page ignores this preference for subframe navigation.

set · iOS 26.0+

preferredContentMode

TypeScript
setPreferredContentMode(value: WebPage_NavigationPreferences_ContentMode): Promise<void>
Swift declaration
var preferredContentMode: WebPage.NavigationPreferences.ContentMode

The content mode for the web view to use when it loads and renders a webpage. The default value of this property is `recommended`. The web page ignores this preference for subframe navigation.

get · iOS 26.0+

isLockdownModeEnabled

TypeScript
get isLockdownModeEnabled(): Promise<boolean>
Swift declaration
var isLockdownModeEnabled: Bool { get set }

A Boolean value that indicates whether to use Lockdown Mode in the web page. By default, this reflects whether the user has enabled Lockdown Mode on the device. Update this preference to override the device setting when you implement a per-website or similar setting.

set · iOS 26.0+

isLockdownModeEnabled

TypeScript
setIsLockdownModeEnabled(value: boolean): Promise<void>
Swift declaration
var isLockdownModeEnabled: Bool { get set }

A Boolean value that indicates whether to use Lockdown Mode in the web page. By default, this reflects whether the user has enabled Lockdown Mode on the device. Update this preference to override the device setting when you implement a per-website or similar setting.

get · iOS 26.0+

allowsContentJavaScript

TypeScript
get allowsContentJavaScript(): Promise<boolean>
Swift declaration
var allowsContentJavaScript: Bool

Indicates whether JavaScript from web content is allowed to run. The default value of this property is `true`. If you change the value to `false`, the web page doesn’t execute JavaScript code referenced by the web content. That includes JavaScript code found in inline `<script>` elements, `javascript:` URLs, and all other referenced JavaScript content.

set · iOS 26.0+

allowsContentJavaScript

TypeScript
setAllowsContentJavaScript(value: boolean): Promise<void>
Swift declaration
var allowsContentJavaScript: Bool

Indicates whether JavaScript from web content is allowed to run. The default value of this property is `true`. If you change the value to `false`, the web page doesn’t execute JavaScript code referenced by the web content. That includes JavaScript code found in inline `<script>` elements, `javascript:` URLs, and all other referenced JavaScript content.

get · iOS 26.4+

securityRestrictionMode

TypeScript
get securityRestrictionMode(): Promise<WebPage_NavigationPreferences_SecurityRestrictionMode>
Swift declaration
var securityRestrictionMode: WebPage.NavigationPreferences.SecurityRestrictionMode { get set }

Security restriction mode for this navigation. Security restriction modes provide different levels of security hardening for high-risk browsing contexts. `SecurityRestrictionMode.maximizeCompatibility` provides additional hardening while maintaining full web compatibility: - JavaScript JIT compilation disabled (interpreter-only execution) - Increased Memory Tagging Extension (MTE) coverage across allocations in the WebContent process Setting a security restriction mode creates separate, isolated WebContent processes for the specified protection level. This preference only applies to main frame navigations and will be ignored for subframe navigations. When set for a main frame, all subframe content and opened windows inherit the same security restrictions. When the system has chosen `SecurityRestrictionMode.lockdown` (e.g., in Lockdown Mode), attempts to set a less restrictive mode will fail silently. The default value is `SecurityRestrictionMode.none`.

set · iOS 26.4+

securityRestrictionMode

TypeScript
setSecurityRestrictionMode(value: WebPage_NavigationPreferences_SecurityRestrictionMode): Promise<void>
Swift declaration
var securityRestrictionMode: WebPage.NavigationPreferences.SecurityRestrictionMode { get set }

Security restriction mode for this navigation. Security restriction modes provide different levels of security hardening for high-risk browsing contexts. `SecurityRestrictionMode.maximizeCompatibility` provides additional hardening while maintaining full web compatibility: - JavaScript JIT compilation disabled (interpreter-only execution) - Increased Memory Tagging Extension (MTE) coverage across allocations in the WebContent process Setting a security restriction mode creates separate, isolated WebContent processes for the specified protection level. This preference only applies to main frame navigations and will be ignored for subframe navigations. When set for a main frame, all subframe content and opened windows inherit the same security restrictions. When the system has chosen `SecurityRestrictionMode.lockdown` (e.g., in Lockdown Mode), attempts to set a less restrictive mode will fail silently. The default value is `SecurityRestrictionMode.none`.

get · iOS 27.0+

isGlobalPrivacyControlEnabled

TypeScript
get isGlobalPrivacyControlEnabled(): Promise<boolean>
Swift declaration
var isGlobalPrivacyControlEnabled: Bool

Whether the Global Privacy Control (GPC) signal is enabled for the navigation. The default value of this property is `false`. When enabled, both `navigator.globalPrivacyControl` and the `Sec-GPC: 1` request header are active for the main frame, its subframes, and their subresources.

set · iOS 27.0+

isGlobalPrivacyControlEnabled

TypeScript
setIsGlobalPrivacyControlEnabled(value: boolean): Promise<void>
Swift declaration
var isGlobalPrivacyControlEnabled: Bool

Whether the Global Privacy Control (GPC) signal is enabled for the navigation. The default value of this property is `false`. When enabled, both `navigator.globalPrivacyControl` and the `Sec-GPC: 1` request header are active for the main frame, its subframes, and their subresources.

get · iOS 26.0+

preferredHTTPSNavigationPolicy

TypeScript
get preferredHTTPSNavigationPolicy(): Promise<WebPage_NavigationPreferences_UpgradeToHTTPSPolicy>
Swift declaration
var preferredHTTPSNavigationPolicy: WebPage.NavigationPreferences.UpgradeToHTTPSPolicy

Used when performing a top-level navigation to a webpage. The default value is `.keepAsRequested`. The stated preference is ignored on subframe navigation, and it may be ignored based on system configuration. The `WebPage.Configuration.upgradeKnownHostsToHTTPS` property supersedes this property for known hosts.

set · iOS 26.0+

preferredHTTPSNavigationPolicy

TypeScript
setPreferredHTTPSNavigationPolicy(value: WebPage_NavigationPreferences_UpgradeToHTTPSPolicy): Promise<void>
Swift declaration
var preferredHTTPSNavigationPolicy: WebPage.NavigationPreferences.UpgradeToHTTPSPolicy

Used when performing a top-level navigation to a webpage. The default value is `.keepAsRequested`. The stated preference is ignored on subframe navigation, and it may be ignored based on system configuration. The `WebPage.Configuration.upgradeKnownHostsToHTTPS` property supersedes this property for known hosts.

init · iOS 26.0+

init

TypeScript
static init(): Promise<WebPage_NavigationPreferences>
Swift declaration
init()

Creates a new NavigationPreferences value.

Skipped declarations

No declarations were skipped in this snapshot.

All WebKit types →