Platforms to show: All Mac Windows Linux Cross-Platform
Back to WebView2ControlMBS control.
WebView2ControlMBS.SourceChanged(isNewDocument as Boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebView2 | MBS WinFrameworks Plugin | 20.5 | ❌ No | ✅ Yes | ❌ No | ❌ No |
SourceChanged fires when the Source property changes. SourceChanged fires for navigating to a different site or fragment navigations. It will not fire for other types of navigations such as page reloads or history.pushState with the same URL as the current page. SourceChanged fires before ContentLoading for navigation to a new document.
WebView2ControlMBS.WebMessageReceived(Source as String, webMessageAsJson as String, webMessageAsString as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebView2 | MBS WinFrameworks Plugin | 20.5 | ❌ No | ✅ Yes | ❌ No | ❌ No |
WebMessageReceived fires when the IsWebMessageEnabled setting is set and the top level document of the WebView calls window.chrome.webview.postMessage. The postMessage function is void postMessage(object) where object is any object supported by JSON conversion.
webMessageAsString is empty if we can't serialize it to text.
WebView2ControlMBS.WindowCloseRequested
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebView2 | MBS WinFrameworks Plugin | 20.5 | ❌ No | ✅ Yes | ❌ No | ❌ No |
WindowCloseRequested fires when content inside the WebView requested to close the window, such as after window.close is called. The app should close the WebView and related app window if that makes sense to the app.
WebView2ControlMBS.ZoomFactorChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebView2 | MBS WinFrameworks Plugin | 20.5 | ❌ No | ✅ Yes | ❌ No | ❌ No |
The event could fire because the caller modified the ZoomFactor property, or due to the user manually modifying the zoom. When it is modified by the caller via the ZoomFactor property, the internal zoom factor is updated immediately and there will be no ZoomFactorChanged event. WebView associates the last used zoom factor for each site. Therefore, it is possible for the zoom factor to change when navigating to a different page. When the zoom factor changes due to this, the ZoomFactorChanged event fires right after the ContentLoading event.
The items on this page are in the following plugins: MBS WinFrameworks Plugin.