[−][src]Trait webview2_sys::ICoreWebView2Settings
Defines properties that enable, disable, or modify WebView features. Setting changes made after NavigationStarting event will not apply until the next top level navigation.
Required methods
unsafe fn get_is_script_enabled(&self, is_script_enabled: *mut BOOL) -> HRESULT
Controls if JavaScript execution is enabled in all future navigations in the WebView. This only affects scripts in the document; scripts injected with ExecuteScript will run even if script is disabled. It is true by default.
\snippet SettingsComponent.cpp IsScriptEnabled
unsafe fn put_is_script_enabled(&self, is_script_enabled: BOOL) -> HRESULT
Set the IsScriptEnabled property.
unsafe fn get_is_web_message_enabled(
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT
The IsWebMessageEnabled property is used when loading a new HTML document. If set to true, communication from the host to the webview's top level HTML document is allowed via PostWebMessageAsJson, PostWebMessageAsString, and window.chrome.webview's message event (see PostWebMessageAsJson documentation for details). Communication from the webview's top level HTML document to the host is allowed via window.chrome.webview's postMessage function and the SetWebMessageReceivedEventHandler method (see the SetWebMessageReceivedEventHandler documentation for details). If set to false, then communication is disallowed. PostWebMessageAsJson and PostWebMessageAsString will fail with E_ACCESSDENIED and window.chrome.webview.postMessage will fail by throwing an instance of an Error object. It is true by default.
\snippet ScenarioWebMessage.cpp IsWebMessageEnabled
unsafe fn put_is_web_message_enabled(
&self,
is_web_message_enabled: BOOL
) -> HRESULT
&self,
is_web_message_enabled: BOOL
) -> HRESULT
Set the IsWebMessageEnabled property.
unsafe fn get_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT
AreDefaultScriptDialogsEnabled is used when loading a new HTML document. If set to false, then WebView won't render the default javascript dialog box (Specifically those shown by the javascript alert, confirm, prompt functions and beforeunload event). Instead, if an event handler is set by SetScriptDialogOpeningEventHandler, WebView will send an event that will contain all of the information for the dialog and allow the host app to show its own custom UI.
unsafe fn put_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT
Set the AreDefaultScriptDialogsEnabled property.
unsafe fn get_is_status_bar_enabled(
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT
IsStatusBarEnabled controls whether the status bar will be displayed. The status bar is usually displayed in the lower left of the WebView and shows things such as the URI of a link when the user hovers over it and other information. It is true by default.
unsafe fn put_is_status_bar_enabled(
&self,
is_status_bar_enabled: BOOL
) -> HRESULT
&self,
is_status_bar_enabled: BOOL
) -> HRESULT
Set the IsStatusBarEnabled property.
unsafe fn get_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT
AreDevToolsEnabled controls whether the user is able to use the context menu or keyboard shortcuts to open the DevTools window. It is true by default.
unsafe fn put_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT
Set the AreDevToolsEnabled property.
unsafe fn get_are_default_context_menus_enabled(
&self,
enabled: *mut BOOL
) -> HRESULT
&self,
enabled: *mut BOOL
) -> HRESULT
The AreDefaultContextMenusEnabled property is used to prevent default context menus from being shown to user in webview. Defaults to TRUE.
\snippet SettingsComponent.cpp DisableContextMenu
unsafe fn put_are_default_context_menus_enabled(&self, enabled: BOOL) -> HRESULT
Set the AreDefaultContextMenusEnabled property
unsafe fn get_are_remote_objects_allowed(&self, allowed: *mut BOOL) -> HRESULT
The AreRemoteObjectsAllowed property is used to control whether remote objects are accessible from the page in webview. Defaults to TRUE.
\snippet SettingsComponent.cpp RemoteObjectsAccess
unsafe fn put_are_remote_objects_allowed(&self, allowed: BOOL) -> HRESULT
Set the AreRemoteObjectsAllowed property
unsafe fn get_is_zoom_control_enabled(&self, enabled: *mut BOOL) -> HRESULT
The IsZoomControlEnabled property is used to prevent the user from impacting the zoom of the WebView. Defaults to TRUE. When disabled, user will not be able to zoom using ctrl+/- or ctrl+mouse wheel, but the zoom can be set via put_ZoomFactor API.
\snippet SettingsComponent.cpp DisableZoomControl
unsafe fn put_is_zoom_control_enabled(&self, enabled: BOOL) -> HRESULT
Set the IsZoomControlEnabled property
Trait Implementations
impl ComInterface for dyn ICoreWebView2Settings[src]
type VTable = ICoreWebView2SettingsVTable
A COM compatible V-Table
type Super = dyn IUnknown
The interface that this interface inherits from
const IID: IID[src]
fn is_iid_in_inheritance_chain(riid: &GUID) -> bool[src]
impl<C: ICoreWebView2Settings> ProductionComInterface<C> for dyn ICoreWebView2Settings[src]
Implementations on Foreign Types
impl<T: ICoreWebView2Settings + ComInterface + ?Sized> ICoreWebView2Settings for ComRc<T>[src]
unsafe fn get_is_script_enabled(&self, is_script_enabled: *mut BOOL) -> HRESULT[src]
unsafe fn put_is_script_enabled(&self, is_script_enabled: BOOL) -> HRESULT[src]
unsafe fn get_is_web_message_enabled(
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT[src]
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_is_web_message_enabled(
&self,
is_web_message_enabled: BOOL
) -> HRESULT[src]
&self,
is_web_message_enabled: BOOL
) -> HRESULT
unsafe fn get_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT[src]
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT[src]
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT
unsafe fn get_is_status_bar_enabled(
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT[src]
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_is_status_bar_enabled(
&self,
is_status_bar_enabled: BOOL
) -> HRESULT[src]
&self,
is_status_bar_enabled: BOOL
) -> HRESULT
unsafe fn get_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT[src]
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT[src]
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT
unsafe fn get_are_default_context_menus_enabled(
&self,
enabled: *mut BOOL
) -> HRESULT[src]
&self,
enabled: *mut BOOL
) -> HRESULT
unsafe fn put_are_default_context_menus_enabled(&self, enabled: BOOL) -> HRESULT[src]
unsafe fn get_are_remote_objects_allowed(&self, allowed: *mut BOOL) -> HRESULT[src]
unsafe fn put_are_remote_objects_allowed(&self, allowed: BOOL) -> HRESULT[src]
unsafe fn get_is_zoom_control_enabled(&self, enabled: *mut BOOL) -> HRESULT[src]
unsafe fn put_is_zoom_control_enabled(&self, enabled: BOOL) -> HRESULT[src]
impl<T: ICoreWebView2Settings + ComInterface + ?Sized> ICoreWebView2Settings for ComPtr<T>[src]
unsafe fn get_is_script_enabled(&self, is_script_enabled: *mut BOOL) -> HRESULT[src]
unsafe fn put_is_script_enabled(&self, is_script_enabled: BOOL) -> HRESULT[src]
unsafe fn get_is_web_message_enabled(
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT[src]
&self,
is_web_message_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_is_web_message_enabled(
&self,
is_web_message_enabled: BOOL
) -> HRESULT[src]
&self,
is_web_message_enabled: BOOL
) -> HRESULT
unsafe fn get_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT[src]
&self,
are_default_script_dialogs_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_are_default_script_dialogs_enabled(
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT[src]
&self,
are_default_script_dialogs_enabled: BOOL
) -> HRESULT
unsafe fn get_is_status_bar_enabled(
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT[src]
&self,
is_status_bar_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_is_status_bar_enabled(
&self,
is_status_bar_enabled: BOOL
) -> HRESULT[src]
&self,
is_status_bar_enabled: BOOL
) -> HRESULT
unsafe fn get_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT[src]
&self,
are_dev_tools_enabled: *mut BOOL
) -> HRESULT
unsafe fn put_are_dev_tools_enabled(
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT[src]
&self,
are_dev_tools_enabled: BOOL
) -> HRESULT
unsafe fn get_are_default_context_menus_enabled(
&self,
enabled: *mut BOOL
) -> HRESULT[src]
&self,
enabled: *mut BOOL
) -> HRESULT