title: Safari:Extension Settings description: The declaration to configure Safari Extensions. payload: declarationtype: com.apple.configuration.safari.extensions.settings supportedOS: iOS: introduced: '18.0' allowed-enrollments: - supervised allowed-scopes: - system sharedipad: allowed-scopes: - user macOS: introduced: '15.0' allowed-enrollments: - supervised allowed-scopes: - user tvOS: introduced: n/a visionOS: introduced: '26.0' allowed-enrollments: - supervised allowed-scopes: - system watchOS: introduced: n/a apply: combined payloadkeys: - key: ManagedExtensions title: Managed extensions type: presence: optional content: |- The dictionary of managed extensions settings. Each key in the dictionary represents a composed identifier for a specific managed extension, or you can specify a single "\*" character to match any extension. The dictionary values represent the settings that Safari applies to each extension that matches the key. In order for the extension to be managed, its host app needs to be present on the device. The composed identifier of a managed extension uses the format "Identifier (TeamIdentifier)", for example "com.example.app (ABCD1234)". Use `codesign -dv ` to show the information you need to generate this string on macOS, using the path to the extension bundle located in the "PlugIns" folder inside the app bundle. For other platforms, request this information from the app developer. subkeys: - key: ANY type: presence: optional content: The dictionary that defines the settings for a managed extension. Each key represents a specific managed extension, or you can specify a single "*" character to match any extension. subkeytype: ExtensionDictionary subkeys: - key: State title: Extension state type: presence: optional rangelist: - Allowed - AlwaysOn - AlwaysOff combinetype: enum-last content: |- Controls whether an extension is allowed. The device uses this key when the extension identifier is a composed identifier or a single "\*" character. * `Allowed` - The user is allowed to turn the extension on or off. * `AlwaysOn` - The extension will always be on. * `AlwaysOff` - The extension will always be off. - key: PrivateBrowsing title: Private browsing state type: presence: optional rangelist: - Allowed - AlwaysOn - AlwaysOff combinetype: enum-last content: |- Controls whether an extension is allowed in Private Browsing. The device uses this key when the extension identifier is a composed identifier or a single "\*" character. * `Allowed` - The user is allowed to turn the extension on or off in Private Browsing. * `AlwaysOn` - The extension will always be on in Private Browsing if the extension is on outside of Private Browsing. * `AlwaysOff` - The extension will never be on in Private Browsing. - key: AllowedDomains title: Allowed domains type: presence: optional combinetype: set-union content: Controls the domains and sub-domains the extension can access. The device ignores this key when the extension identifier is a single "*" character. subkeys: - key: Domain title: Domain type: content: A domain or set of sub-domains where the extension is allowed - key: DeniedDomains title: Denied domains type: presence: optional combinetype: set-union content: Controls the domains and sub-domains the extension isn't allowed to access. The device uses this key when the extension identifier is a composed identifier or a single "*" character. subkeys: - key: Domain title: Domain type: content: A domain or set of sub-domains where the extension is not allowed notes: - title: '' content: |- Safari supports the following values for `AllowedDomains` and `DeniedDomains`: - A specific domain such as "example.com" or "www.example.com". - A wildcard domain that uses a single "\*" character as a prefix for the domain, such as "\*example.com". This matches both the exact domain "example.com", and any sub-domains such as "www.example.com". It won't match other domains with a similar string suffix such as "myexample.com". - A global wildcard specified as a single "\*" character that matches any domain. Safari determines whether a domain is allowed or denied using the following precedence rules: 1. A specific domain takes precedence over the global wildcard or a wildcard domain. 2. A wildcard domain takes precedence over the global wildcard. If the same value appears in both `AllowedDomains` and `DeniedDomains`, Safari denies use of a matching domain. The user can configure any domains not matched by the values in `AllowedDomains` or `DeniedDomains`. - title: Examples content: |- Give an extension access to only "example.com" and its sub-domains, and deny access to everywhere else. ``` json "AllowedDomains": ["*example.com"], "DeniedDomains": ["*"] ``` Give an extension access to "example.com" and its sub-domains, without deny anywhere else. The user can make their own choice for other domains. ``` json "AllowedDomains": ["*example.com"] ``` Give an extension access to "example.com" and its sub-domains, but deny access to "private.example.com" or anywhere else. ``` json "AllowedDomains": ["*example.com"], "DeniedDomains": ["private.example.com", "*"] ``` Give an extension access to "public.example.com", but deny access to "example.com" or any other of its sub-domains. The user can make their own choice for other domains. ``` json "AllowedDomains": ["public.example.com"], "DeniedDomains": ["*example.com"] ``` examples: - title: Configuration examples files: - tab: Disallow all description: This configuration disables all Safari extensions. file: examples/declarative/declarations/configurations/safari.extensions.settings/example1.json - tab: Allow one description: This configuration disables all Safari extensions, except for one that it requires. file: examples/declarative/declarations/configurations/safari.extensions.settings/example2.json - tab: Disallow private browsing description: This configuration allows all Safari extensions, but one isn't allowed in private browsing. file: examples/declarative/declarations/configurations/safari.extensions.settings/example3.json - tab: Disallow domain description: This configuration allows all Safari extensions, but one isn't allowed for use with a domain and its sub-domains. file: examples/declarative/declarations/configurations/safari.extensions.settings/example4.json