Platforms to show: All Mac Windows Linux Cross-Platform

Back to WebView2BrowserMBS class.

WebView2BrowserMBS.areBrowserAcceleratorKeysEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Whether all accelerator keys are enabled.

When this setting is set to false, it disables all accelerator keys that access features specific to a web browser, including but not limited to:

  • Ctrl-F and F3 for Find on Page
  • Ctrl-P for Print
  • Ctrl-R and F5 for Reload
  • Ctrl-Plus and Ctrl-Minus for zooming
  • Ctrl-Shift-C and F12 for DevTools
  • Special keys for browser functions, such as Back, Forward, and Search
It does not disable accelerator keys related to movement and text editing, such as:
  • Home, End, Page Up, and Page Down
  • Ctrl-X, Ctrl-C, Ctrl-V
  • Ctrl-A for Select All
  • Ctrl-Z for Undo
Those accelerator keys will always be enabled unless they are handled in the AcceleratorKeyPressed event.
This setting has no effect on the AcceleratorKeyPressed event. The event will be fired for all accelerator keys, whether they are enabled or not.

The default value for AreBrowserAcceleratorKeysEnabled is true.

Needs WebView2 in version 1.0.864.35 or newer.
(Read and Write property)

WebView2BrowserMBS.AreDefaultContextMenusEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The AreDefaultContextMenusEnabled property is used to prevent default context menus from being shown to user in WebView.

It is true by default.
(Read and Write property)

WebView2BrowserMBS.AreDefaultScriptDialogsEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
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 via add_ScriptDialogOpening, 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. It is true by default.
(Read and Write property)

WebView2BrowserMBS.AreDevToolsEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
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.
(Read and Write property)

WebView2BrowserMBS.AreHostObjectsAllowed as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The AreHostObjectsAllowed property is used to control whether host objects are accessible from the page in WebView.

It is true by default.
(Read and Write property)

WebView2BrowserMBS.BrowserVersionString as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The browser version info of the current environment, including channel name if it is not the stable channel.

This matches the format of the AvailableCoreWebView2BrowserVersionString API. Channel names are 'beta', 'dev', and 'canary'.
(Read only property)

WebView2BrowserMBS.ContainsFullScreenElement as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Indicates if the WebView contains a fullscreen HTML element.

(Read only property)

WebView2BrowserMBS.CookieManager as WebView2BrowserMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Gets the cookie manager object associated with this webview.

Requires WebView2 version 1.0.705.50 from January 2021.
(Read only property)

WebView2BrowserMBS.DefaultDownloadFolderPath as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The default download folder path.

The default value is the system default download folder path for the user. The default download folder path is persisted in the user data folder across sessions. The value should be an absolute path to a folder that the user and application can write to. Throws an exception if the value is invalid, and the default download path is not changed. Otherwise the path is changed immediately. If the directory does not yet exist, it is created at the time of the next download. If the host application does not have permission to create the directory, then the user is prompted to provide a new path through the Save As dialog. The user can override the default download folder path for a given download by choosing a different path in the Save As dialog.
(Read and Write property)

WebView2BrowserMBS.DocumentTitle as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The title for the current top level document.

If the document has no explicit title or is otherwise empty, a default that may or may not match the URI of the document will be used.
(Read only property)

WebView2BrowserMBS.FaviconURI as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Get the current Uri of the favicon as a string.
Example
Var url As String = web.FaviconURI

MessageBox url

If a page has no favicon then the value is an empty string.
(Read only property)

WebView2BrowserMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The internal object reference for the WebView object.

(Read only property)

WebView2BrowserMBS.HiddenPdfToolbarItems as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Customize the PDF toolbar items.

By default, it is 0 and so it displays all of the items. Changes to this property apply to all CoreWebView2s in the same environment and using the same profile. Changes to this setting apply only after the next navigation.

Available values:

Bookmarks256The contents button on PDF toolbar.
FitPage64The fit to width button on PDF toolbar.
FullScreen2048The full screen button on PDF toolbar.
MoreSettings4096The setting and more button on PDF toolbar. Gear icon.
None0No item. By default the HiddenPdfToolbarItems equal to this value.
PageLayout128The page view button on PDF toolbar.
PageSelector512The page number button on PDF toolbar.
Print2The print button on PDF toolbar.
Rotate32The rotate button on PDF toolbar.
Save1The save button on PDF toolbar.
SaveAs4The save as button on PDF toolbar.
Search1024The search button on PDF toolbar.
ZoomIn8The zoom in button on PDF toolbar.
ZoomOut16The zoom out button on PDF toolbar.

Seems like 256 hides the whole toolbar.
(Read and Write property)

WebView2BrowserMBS.MemoryUsageTargetLevel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Indicates desired memory consumption level of WebView.

Scripts will not be impacted and continue to run. This is useful for inactive apps that still want to run scripts and/or keep network connections alive and therefore could not call TrySuspend and Resume to reduce memory consumption. These apps can set memory usage target level to kMemoryUsageTargetLevelLow when the app becomes inactive, and set back to kMemoryUsageTargetLevelNormal when the app becomes active.

It is not necessary to set CoreWebView2Controller's IsVisible property to false when setting the property. It is a best effort operation to change memory usage level, and the API will return before the operation completes. Setting the level to kMemoryUsageTargetLevelLow could potentially cause memory for some WebView browser processes to be swapped out to disk in some circumstances. It is a best effort to reduce memory usage as much as possible. If a script runs after its related memory has been swapped out, the memory will be swapped back in to ensure the script can still run, but performance might be impacted. Therefore, the app should set the level back to kMemoryUsageTargetLevelNormal when the app becomes active again. Setting memory usage target level back to normal will not happen automatically.

An app should choose to use either the combination of TrySuspend and Resume or the combination of setting MemoryUsageTargetLevel to low and normal. It is not advisable to mix them. Trying to set MemoryUsageTargetLevel while suspended will be ignored. The TrySuspend and Resume methods will change the MemoryUsageTargetLevel. TrySuspend will automatically set MemoryUsageTargetLevel to low while Resume on suspended WebView will automatically set MemoryUsageTargetLevel to normal. Calling Resume when the WebView is not suspended would not change MemoryUsageTargetLevel.
(Read and Write property)

WebView2BrowserMBS.PreferredColorScheme as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The PreferredColorScheme property sets the overall color scheme of the WebView2s associated with this profile.
Example
var web as WebView2BrowserMBS // your web viewer
web.PreferredColorScheme = web.kPreferredColorSchemeDark

This sets the color scheme for WebView2 UI like dialogs, prompts, and menus by setting the media feature prefers-color-scheme. The default value for this is kPreferredColorSchemeAuto, which will follow whatever color scheme the OS is currently set to.
(Read and Write property)

WebView2BrowserMBS.ProcessID as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The process id of the browser process that hosts the WebView.

(Read only property)

WebView2BrowserMBS.ProfilePath as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Full path of the profile directory.

(Read only property)

WebView2BrowserMBS.SettingsHandle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The internal object reference for the settings object.

(Read only property)

WebView2BrowserMBS.URL as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The URI of the current top level document.

This value potentially changes as a part of the SourceChanged event firing for some cases such as navigating to a different site or fragment navigations. It will remain the same for other types of navigations such as page reloads or history.pushState with the same URL as the current page.

If assigned, calls LoadURL method.
(Read and Write property)

WebView2BrowserMBS.UserAgent as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 26.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The User Agent.

The default value is the default User Agent of the Microsoft Edge browser.

This property may be overridden if the User-Agent header is set in a request. If the parameter is empty the User Agent will not be updated and the current User Agent will remain.

Needs WebView2 in version 1.0.864.35 or newer.
(Read and Write property)

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...