Platforms to show: All Mac Windows Linux Cross-Platform
Back to DesktopWKWebViewControlMBS control.
DesktopWKWebViewControlMBS.BoundsChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
DesktopWKWebViewControlMBS.Closing
Type | Topic | Version |
event | WebKit2 | 21.5 |
The control is about to close.
In older Xojo versions, this event is named Close.
DesktopWKWebViewControlMBS.ConstructContextualMenu(base as DesktopMenuItem, x as Integer, y as Integer) As Boolean
Type | Topic | Version |
event | WebKit2 | 22.1 |
DesktopWKWebViewControlMBS.ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean
Type | Topic | Version |
event | WebKit2 | 21.5 |
This allows the control to react on its relevant menu items. Please return true if you handled it or false to give others a chance.
DesktopWKWebViewControlMBS.CreateWebView(URL as String, request as NSURLRequestMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
If needed we can add configuration, windowFeatures and navigationAction parameters in future version.
Return a web viewer control or nil.
The web view returned must be created with the specified configuration. WebKit will load the request in the returned web view.
If you do not implement this method or return nil, the web view will cancel the navigation.
DesktopWKWebViewControlMBS.decidePolicyForNavigationAction(navigationAction as WKNavigationActionMBS, decisionHandler as WKPolicyForNavigationActionDecisionHandlerMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Please inspect navigationAction to find the information about what action happened.
You can show a dialog to ask user and once you know the decision call a method on decisionHandler object to report the decision.
If you want to open this in a new window/tab, please call decisionHandler.Cancel method here, take the URL and load it in the new WebView in the new window/tab.
Like the CancelClose event in Xojo, you can call decisionHandler.Cancel method to call it.
DesktopWKWebViewControlMBS.decidePolicyForNavigationResponse(navigationResponse as WKNavigationResponseMBS, decisionHandler as WKPolicyForNavigationResponseDecisionHandlerMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
navigationResponse: Descriptive information about the navigation response.
You can show a dialog to ask user and once you know the decision call a method on decisionHandler object to report the decision.
DesktopWKWebViewControlMBS.DidClose
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notifies your app that the DOM window object's close() method completed successfully.
Your app should remove the web view from the view hierarchy and update the UI as needed, such as by closing the containing browser tab or window.
DesktopWKWebViewControlMBS.didCloseContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Allows you to restart any animation you may have stopped in the willShowContextualMenu event.
DesktopWKWebViewControlMBS.didCommitNavigation(navigation as WKNavigationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
DesktopWKWebViewControlMBS.didFailNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
DesktopWKWebViewControlMBS.didFailProvisionalNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
DesktopWKWebViewControlMBS.didFinishNavigation(navigation as WKNavigationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
Same as DocumentComplete in HTMLViewer.
DesktopWKWebViewControlMBS.DidReceiveAuthenticationChallenge(challenge as NSURLAuthenticationChallengeMBS, byref AuthChallengeDisposition as Integer, byref credentials as NSURLCredentialMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
challenge: The authentication challenge.
AuthChallengeDisposition: The option to use to handle the challenge. For a list of options, see AuthChallenge* constants.
credential: The credential to use for authentication when the disposition parameter contains the value AuthChallengeUseCredential. Specify nil to continue without a credential.
If you don’t implement this method, the web view responds to the authentication challenge with the AuthChallengeRejectProtectionSpace disposition.
DesktopWKWebViewControlMBS.didReceiveScriptMessage(Body as Variant, name as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
body: The body of the message. Automatic translated from Javascript types.
name: The name of the message handler to which the message is sent.
DesktopWKWebViewControlMBS.didReceiveServerRedirectForProvisionalNavigation(navigation as WKNavigationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
DesktopWKWebViewControlMBS.didStartProvisionalNavigation(navigation as WKNavigationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Added navigation parameter with version 20.3.
Sets Navigation property.
DesktopWKWebViewControlMBS.downloadDecideDestinationUsingResponse(download as WKDownloadMBS, response as NSURLResponseMBS, suggestedFilename as String, byref destination as FolderItem)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
download: The download that needs a file destination where the systems should write the download data.
response: A response from the server for an HTTP request, or a synthesized response for a blob download.
suggestedFilename: A string with a filename suggestion to use in creating the file destination.
destination: A file destination where the systems should write the download data.
Set destination to where to store the file. Or set to nil to cancel.
The suggested filename can come from the response or from the web content.
The destination file URL must meet the following requirements:
- It’s a file that doesn’t exist.
- It’s in a directory that exists.
- It’s in a directory that WebKit can write to.
DesktopWKWebViewControlMBS.downloadDidFailWithError(download as WKDownloadMBS, error as NSErrorMBS, resumeData as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
download: The download that failed.
error: An error describing what caused the download to fail.
resumeData: A data object you use to restart the download.
To restart a failed download, call resumeDownloadFromResumeData with resumeData.
DesktopWKWebViewControlMBS.downloadDidFinish(download as WKDownloadMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
download: The download that finished.
DesktopWKWebViewControlMBS.downloadDidReceiveAuthenticationChallenge(download as WKDownloadMBS, challenge as NSURLAuthenticationChallengeMBS, byref AuthChallengeDisposition as Integer, byref credentials as NSURLCredentialMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
download: The download that received the authentication challenge.
challenge: The authentication challenge.
Determine how to respond to the authentication challenge in this method. Then set AuthChallengeDisposition to AuthChallenge* constants and pass the credentials to use.
If you don’t implement this method, the web view responds to the challenge with AuthChallengeRejectProtectionSpace.
DesktopWKWebViewControlMBS.downloadWillPerformHTTPRedirection(download as WKDownloadMBS, response as NSURLResponseMBS, request as NSURLRequestMBS, byref DownloadRedirectPolicy as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
download: The download that receives the redirect response.
response: The redirect response.
request: The new request the web view sends as a result of the redirect response.
Set DownloadRedirectPolicy to either DownloadRedirectPolicyAllow or DownloadRedirectPolicyCancel.
A download redirect policy that indicates whether to proceed with the redirect.
Determine whether to proceed with the redirect. Then invoke the decisionHandler closure, providing a download redirect policy that indicates whether to proceed with the redirect.
If you don’t implement this event, the web view proceeds with all redirects.
DesktopWKWebViewControlMBS.EstimatedProgressChanged(estimatedProgress as double, oldEstimatedProgress as double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
This event may be called often, so don't do much here!
DesktopWKWebViewControlMBS.FocusLost
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control lost focus.
In older Xojo versions, this event is named LostFocus.
This only fires if the control itself lost focus and not a sub control.
DesktopWKWebViewControlMBS.FocusReceived
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control itself got focus.
In older Xojo versions, this event is named GotFocus.
This only fires if the control itself got focus and not a sub control.
DesktopWKWebViewControlMBS.FrameChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
This event notifies you, that the control changed it's bounding frame, which is position and/or size.
DesktopWKWebViewControlMBS.JavaScriptEvaluated(JavaScript as String, Result as Variant, Error as NSErrorMBS, Tag as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Error is only set with 64-bit, not with 32-bit.
Tag is passed from EvaluateJavaScript call.
Result is converted from JavaScript data types to Xojo datatypes, usually variants, dictionaries or array of variants.
DesktopWKWebViewControlMBS.MenuBarSelected
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The event where you can enable menu items.
In older Xojo versions, this event is named EnableMenuItems.
DesktopWKWebViewControlMBS.MouseDown(x as Integer, y as Integer, Modifiers as Integer) As Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The coordinates x and y are local to the control, i.e. they represent the position of the mouse click relative to the upper-left corner or the Control.
Return True if you are going to handle the MouseDown. In such a case:
- The Action event, if any, will not execute and the state of the object will not change.
- You will receive the MouseDrag and MouseUp events.
DesktopWKWebViewControlMBS.MouseDrag(x as Integer, y as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Mouse location is local to the control passed in to x, y.
As this event is fired continuously (hundreds of time per second), it is your responsibility to determine if the mouse has really moved.
DesktopWKWebViewControlMBS.MouseUp(x as Integer, y as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Use the x and y parameters to determine if the mouse button was released within the control's boundaries.
DesktopWKWebViewControlMBS.navigationActionDidBecomeDownload(navigationAction as WKNavigationActionMBS, download as WKDownloadMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
navigationAction: Descriptive information about the navigation response that turned into a download.
download: An object that represents the download of a web resource.
Implement this method to begin tracking download progress.
DesktopWKWebViewControlMBS.navigationResponseDidBecomeDownload(navigationResponse as WKNavigationResponseMBS, download as WKDownloadMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
navigationResponse: Descriptive information about the navigation response that turned into a download.
download: An object that represents the download of a web resource.
Implement this method to begin tracking download progress.
DesktopWKWebViewControlMBS.Opening
Type | Topic | Version |
event | WebKit2 | 21.5 |
The control is about to was created and you can initialize it.
In older Xojo versions, this event is named Open.
DesktopWKWebViewControlMBS.pauseAllMediaPlaybackCompleted New in 24.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
DesktopWKWebViewControlMBS.requestMediaPlaybackStateCompleted(state as Integer) New in 24.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
State: A value that indicates whether the media in the web view is playing, paused, or suspended. If there’s no media in the web view to play, this method provides MediaPlaybackStateNone.
DesktopWKWebViewControlMBS.runJavaScriptAlertPanel(initiatedByFrame as WKFrameInfoMBS, message as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
message: The message to display.
If you do not implement this method, the web view will behave as if the user selected the OK button.
DesktopWKWebViewControlMBS.runJavaScriptConfirmPanel(initiatedByFrame as WKFrameInfoMBS, message as String) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
message: The message to display.
Return true if the user chose OK, false if the user chose Cancel.
If you do not implement this method, the web view will behave as if the user selected the Cancel button.
DesktopWKWebViewControlMBS.runJavaScriptTextInputPanel(initiatedByFrame as WKFrameInfoMBS, prompt as String, defaultText as String) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
message: The message to display.
defaultText: The initial text to display in the text entry field.
Return the entered text if the user chose OK, otherwise "".
If you do not implement this method, the web view will behave as if the user selected the Cancel button.
DesktopWKWebViewControlMBS.runOpenPanelWithParameters(initiatedByFrame as WKFrameInfoMBS, allowsMultipleSelection as Boolean, allowsDirectories as Boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Please call runOpenPanelWithParametersCompleted method later with result. Pass the selected URLs if the user chose "OK", otherwise nil.
You can use sheet window for the file picker and later call the runOpenPanelWithParametersCompleted method or call it right in the event if you do it synchronously.
If this method is not implemented, the web view behaves as if the user selected the Cancel button.
Not available on iOS. Implemented for macOS 64-bit applications.
DesktopWKWebViewControlMBS.ScaleFactorChanged(NewFactor as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Please invalidate any cached bitmaps or other relevant state.
DesktopWKWebViewControlMBS.takeSnapshotCompleted(image as NSImageMBS, error as NSErrorMBS, tag as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
If snapshot creation failed, error is set.
DesktopWKWebViewControlMBS.TitleChanged(Title as String, oldTitle as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
DesktopWKWebViewControlMBS.WebContentProcessDidTerminate
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Web views use a separate process to render and manage web content. WebKit calls this method when the process for the specified web view terminates for any reason.
DesktopWKWebViewControlMBS.willShowContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Your chance to modify the menu before it is shown, e.g. to add menu entries.
The items on this page are in the following plugins: MBS Mac64bit Plugin.