Platforms to show: All Mac Windows Linux Cross-Platform
Back to WKWebViewControlMBS control.
WKWebViewControlMBS.BoundsChanged
Function:
The event called when the bounds, but not the frame, changed.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
WKWebViewControlMBS.Close
Function:
The control is about to close.
In Xojo version 2021r3 and newer this event is named Closing.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 16.4 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control is about to close.
In Xojo version 2021r3 and newer this event is named Closing.
WKWebViewControlMBS.Closing
Function:
The control is about to close.
In older Xojo versions, this event is named Close.
Type | Topic | Version |
event | WebKit2 | 16.4 |
The control is about to close.
In older Xojo versions, this event is named Close.
WKWebViewControlMBS.ConstructContextualMenu(base as MenuItem, x as Integer, y as Integer) as Boolean
Function:
This event is called when it is appropriate to display a contextual menu for the control.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
WKWebViewControlMBS.ContextualMenuAction(hitItem as MenuItem) as Boolean
Function:
Called when a menuitem is choosen.
Notes: 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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes: 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.
WKWebViewControlMBS.CreateWebView(URL as String, request as NSURLRequestMBS) as Variant
Function:
Creates a new web view.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 20.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.decidePolicyForNavigationAction(navigationAction as WKNavigationActionMBS, decisionHandler as WKPolicyForNavigationActionDecisionHandlerMBS)
Function:
Decides whether to allow or cancel a navigation.
Notes:
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.
Like the CancelClose event in Xojo, you can call decisionHandler.Cancel method to call it.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
Like the CancelClose event in Xojo, you can call decisionHandler.Cancel method to call it.
WKWebViewControlMBS.decidePolicyForNavigationResponse(navigationResponse as WKNavigationResponseMBS, decisionHandler as WKPolicyForNavigationResponseDecisionHandlerMBS)
Function:
Decides whether to allow or cancel a navigation after its response is known.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Example:
Sub decidePolicyForNavigationResponse(navigationResponse as WKNavigationResponseMBS, decisionHandler as WKPolicyForNavigationResponseDecisionHandlerMBS) Handles decidePolicyForNavigationResponse
dim MimeType as string = navigationResponse.response.MIMEType
if MimeType = "application/zip" or _
MimeType = "application/x-tar" or _
MimeType = "application/octet-stream" then
// we download archive files
decisionHandler.Download
else
// allow normal website to load
decisionHandler.Allow
end if
End Sub
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.
WKWebViewControlMBS.DidClose
Function:
The webviewer closed.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 20.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.didCloseContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)
Function:
Will close contextual menu.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 21.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
WKWebViewControlMBS.didCommitNavigation(navigation as WKNavigationMBS)
Function:
Invoked when content starts arriving for the main frame.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewControlMBS.didFailNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Function:
Invoked when an error occurs during a committed main frame navigation.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewControlMBS.didFailProvisionalNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Function:
Invoked when an error occurs while starting to load data for the main frame.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewControlMBS.didFinishNavigation(navigation as WKNavigationMBS)
Function:
Invoked when a main frame navigation completes.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Same as DocumentComplete in HTMLViewer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Same as DocumentComplete in HTMLViewer.
WKWebViewControlMBS.DidReceiveAuthenticationChallenge(challenge as NSURLAuthenticationChallengeMBS, byref AuthChallengeDisposition as Integer, byref credentials as NSURLCredentialMBS)
Function:
Asks the app to respond to an authentication challenge.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.didReceiveScriptMessage(Body as Variant, name as String)
Function:
Invoked when a script message is received from a webpage.
Notes:
body: The body of the message. Automatic translated from Javascript types.
name: The name of the message handler to which the message is sent.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 18.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
body: The body of the message. Automatic translated from Javascript types.
name: The name of the message handler to which the message is sent.
WKWebViewControlMBS.didReceiveServerRedirectForProvisionalNavigation(navigation as WKNavigationMBS)
Function:
Invoked when a server redirect is received for the main frame.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewControlMBS.didStartProvisionalNavigation(navigation as WKNavigationMBS)
Function:
Invoked when a main frame navigation starts.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewControlMBS.downloadDecideDestinationUsingResponse(download as WKDownloadMBS, response as NSURLResponseMBS, suggestedFilename as String, byref destination as FolderItem)
Function:
Asks the app to provide a file destination where the system should write the download data.
Notes:
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:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.downloadDidFailWithError(download as WKDownloadMBS, error as NSErrorMBS, resumeData as MemoryBlock)
Function:
Tells your app that the download failed, with error information and data you can use to restart the download.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.downloadDidFinish(download as WKDownloadMBS)
Function:
This event tells you that the download finished.
Notes: download: The download that finished.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes: download: The download that finished.
WKWebViewControlMBS.downloadDidReceiveAuthenticationChallenge(download as WKDownloadMBS, challenge as NSURLAuthenticationChallengeMBS, byref AuthChallengeDisposition as Integer, byref credentials as NSURLCredentialMBS)
Function:
Asks the delegate to respond to an authentication challenge.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.downloadWillPerformHTTPRedirection(download as WKDownloadMBS, response as NSURLResponseMBS, request as NSURLRequestMBS, byref DownloadRedirectPolicy as Integer)
Function:
Asks the delegate to respond to the download’s redirect response.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 22.3 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes:
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.
WKWebViewControlMBS.EnableMenuItems
Function:
The event where you can enable menu items.
In Xojo version 2021r3 and newer this event is named MenuBarSelected.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The event where you can enable menu items.
In Xojo version 2021r3 and newer this event is named MenuBarSelected.
WKWebViewControlMBS.EstimatedProgressChanged(estimatedProgress as double, oldEstimatedProgress as double)
Function:
The estimated progress for loading the webpage changed.
Notes: This event may be called often, so don't do much here!
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 19.0 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes: This event may be called often, so don't do much here!
WKWebViewControlMBS.FocusLost
Function:
The control lost focus.
In older Xojo versions, this event is named LostFocus.
Notes: This only fires if the control itself lost focus and not a sub control.
Type | Topic | Version |
event | WebKit2 | 17.1 |
The control lost focus.
In older Xojo versions, this event is named LostFocus.
Notes: This only fires if the control itself lost focus and not a sub control.
WKWebViewControlMBS.FocusReceived
Function:
The control itself got focus.
In older Xojo versions, this event is named GotFocus.
Notes: This only fires if the control itself got focus and not a sub control.
Type | Topic | Version |
event | WebKit2 | 17.1 |
The control itself got focus.
In older Xojo versions, this event is named GotFocus.
Notes: This only fires if the control itself got focus and not a sub control.
WKWebViewControlMBS.FrameChanged
Function:
The event called when the frame changed.
Notes: This event notifies you, that the control changed it's bounding frame, which is position and/or size.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notes: This event notifies you, that the control changed it's bounding frame, which is position and/or size.
WKWebViewControlMBS.GotFocus
Function:
The control itself got focus.
In Xojo version 2021r3 and newer this event is named FocusReceived.
Notes: This only fires if the control itself got focus and not a sub control.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | WebKit2 | MBS Mac64bit Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control itself got focus.
In Xojo version 2021r3 and newer this event is named FocusReceived.
Notes: This only fires if the control itself got focus and not a sub control.
The items on this page are in the following plugins: MBS Mac64bit Plugin.
