The OpenD Programming Language

ICoreWebView2Profile3.get_PreferredTrackingPreventionLevel

The PreferredTrackingPreventionLevel property allows you to control levels of tracking prevention for WebView2 which are associated with a profile. This level would apply to the context of the profile. That is, all WebView2s sharing the same profile will be affected and also the value is persisted in the user data folder.

See COREWEBVIEW2_TRACKING_PREVENTION_LEVEL for descriptions of levels.

If tracking prevention feature is enabled when creating the WebView2 environment, you can also disable tracking prevention later using this property and COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE value but that doesn't improves runtime performance.

There is ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention property to enable/disable tracking prevention feature for all the WebView2's created in the same environment. If enabled, PreferredTrackingPreventionLevel is set to COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED by default for all the WebView2's and profiles created in the same environment or is set to the level whatever value was last changed/persisted to the profile. If disabled PreferredTrackingPreventionLevel is not respected by WebView2. If PreferredTrackingPreventionLevel is set when the feature is disabled, the property value get changed and persisted but it will takes effect only if ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention is true.

See ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention for more details. \snippet SettingsComponent.cpp SetTrackingPreventionLevel

interface ICoreWebView2Profile3
@" propget"
HRESULT
get_PreferredTrackingPreventionLevel
(
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL* value
)

Meta