Platforms to show: All Mac Windows Linux Cross-Platform

Back to WKWebViewIOSControlMBS control.

Next items

WKWebViewIOSControlMBS.Close
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: The control is about to close.
WKWebViewIOSControlMBS.CreateWebView(URL as String, request as NSURLRequestMBS) as WKWebViewIOSControlMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.decidePolicyForNavigationAction(navigationAction as WKNavigationActionMBS, decisionHandler as WKPolicyForNavigationActionDecisionHandlerMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 22.3 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.decidePolicyForNavigationResponse(navigationResponse as WKNavigationResponseMBS, decisionHandler as WKPolicyForNavigationResponseDecisionHandlerMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 22.3 ❌ No ❌ No ❌ No ✅ Yes
Function: Decides whether to allow or cancel a navigation after its response is known.
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
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.
WKWebViewIOSControlMBS.DidClose
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.didCommitNavigation(navigation as WKNavigationMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Invoked when content starts arriving for the main frame.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewIOSControlMBS.didFailNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Invoked when an error occurs during a committed main frame navigation.
Notes: Sets Navigation property.
WKWebViewIOSControlMBS.didFailProvisionalNavigation(navigation as WKNavigationMBS, Error as NSErrorMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.didFinishNavigation(navigation as WKNavigationMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Invoked when a main frame navigation completes.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
Same as DocumentComplete in HTMLViewer.
WKWebViewIOSControlMBS.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 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.didReceiveScriptMessage(Body as Variant, name as String)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.didReceiveServerRedirectForProvisionalNavigation(navigation as WKNavigationMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Invoked when a server redirect is received for the main frame.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewIOSControlMBS.didStartProvisionalNavigation(navigation as WKNavigationMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Invoked when a main frame navigation starts.
Notes:
Added navigation parameter with version 20.3.
Sets Navigation property.
WKWebViewIOSControlMBS.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 ❌ No ❌ No ❌ No ✅ Yes
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:
  • 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.
WKWebViewIOSControlMBS.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 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.downloadDidFinish(download as WKDownloadMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 22.3 ❌ No ❌ No ❌ No ✅ Yes
Function: This event tells you that the download finished.
Notes: download: The download that finished.
WKWebViewIOSControlMBS.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 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.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 ❌ No ❌ No ❌ No ✅ Yes
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.
WKWebViewIOSControlMBS.EstimatedProgressChanged(estimatedProgress as double, oldEstimatedProgress as double)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: The estimated progress for loading the webpage changed.
Notes: This event may be called often, so don't do much here!
WKWebViewIOSControlMBS.GotFocus
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: The control itself got focus.
Notes: This only fires if the control itself got focus and not a sub control.
WKWebViewIOSControlMBS.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.0 ❌ No ❌ No ❌ No ✅ Yes
Function: JavaScript was evaluated.
Notes:
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.
WKWebViewIOSControlMBS.LostFocus
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: The control lost focus.
Notes: This only fires if the control itself lost focus and not a sub control.
WKWebViewIOSControlMBS.navigationActionDidBecomeDownload(navigationAction as WKNavigationActionMBS, download as WKDownloadMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 22.3 ❌ No ❌ No ❌ No ✅ Yes
Function: Tells the app that a navigation action became a download.
Example:

Sub navigationActionDidBecomeDownload(navigationAction as WKNavigationActionMBS, download as WKDownloadMBS) Handles navigationActionDidBecomeDownload
System.DebugLog CurrentMethodName

// add download to your list of downloads you monitor
End Sub
Notes:
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.
WKWebViewIOSControlMBS.navigationResponseDidBecomeDownload(navigationResponse as WKNavigationResponseMBS, download as WKDownloadMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 22.3 ❌ No ❌ No ❌ No ✅ Yes
Function: Tells the app that a navigation response became a download.
Example:

Sub navigationResponseDidBecomeDownload(navigationResponse as WKNavigationResponseMBS, download as WKDownloadMBS) Handles navigationResponseDidBecomeDownload
System.DebugLog CurrentMethodName

// add download to your list of downloads you monitor
End Sub
Notes:
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.
WKWebViewIOSControlMBS.Open
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: The control is about to was created and you can initialize it.
WKWebViewIOSControlMBS.runJavaScriptAlertPanel(initiatedByFrame as WKFrameInfoMBS, message as String)
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Displays a JavaScript alert panel.
Notes:
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.
WKWebViewIOSControlMBS.runJavaScriptConfirmPanel(initiatedByFrame as WKFrameInfoMBS, message as String) as boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
event WebKit2 MBS Mac64bit Plugin 21.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Displays a JavaScript confirm panel.
Notes:
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.
WKWebViewIOSControlMBS.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.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Displays a JavaScript text input panel.
Notes:
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.
WKWebViewIOSControlMBS.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.0 ❌ No ❌ No ❌ No ✅ Yes
Function: Called when snapshot of website is completed.
Notes: If snapshot creation failed, error is set.

Next items

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


💬 Ask a question or report a problem
The biggest plugin in space...


Start Chat