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 |
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
- Home, End, Page Up, and Page Down
- Ctrl-X, Ctrl-C, Ctrl-V
- Ctrl-A for Select All
- Ctrl-Z for Undo
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 |
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 |
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 |
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 |
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 |
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 |
(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 |
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 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 |
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 |
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 |
(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 |
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:
| Bookmarks | 256 | The contents button on PDF toolbar. |
| FitPage | 64 | The fit to width button on PDF toolbar. |
| FullScreen | 2048 | The full screen button on PDF toolbar. |
| MoreSettings | 4096 | The setting and more button on PDF toolbar. Gear icon. |
| None | 0 | No item. By default the HiddenPdfToolbarItems equal to this value. |
| PageLayout | 128 | The page view button on PDF toolbar. |
| PageSelector | 512 | The page number button on PDF toolbar. |
| 2 | The print button on PDF toolbar. | |
| Rotate | 32 | The rotate button on PDF toolbar. |
| Save | 1 | The save button on PDF toolbar. |
| SaveAs | 4 | The save as button on PDF toolbar. |
| Search | 1024 | The search button on PDF toolbar. |
| ZoomIn | 8 | The zoom in button on PDF toolbar. |
| ZoomOut | 16 | The 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 |
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 |
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 |
(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 |
(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 |
(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 |
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 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.