Platforms to show: All Mac Windows Linux Cross-Platform

Back to WKWebViewMBS class.

WKWebViewMBS.allowFileAccessFromFileURLs as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Allow file access for file URLs.
Example
Dim browser As WKWebViewMBS // your instance

browser.allowFileAccessFromFileURLs = True

Access to files is allowed for some files.
Please check WebKit documentation for details.

Set allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs to true to disable all the security checks to block local file access for websites. allowUniversalAccessFromFileURLs would allow all file URLs. allowFileAccessFromFileURLs would only allow in same path.
(Read and Write property)

WKWebViewMBS.allowsBackForwardNavigationGestures as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value indicating whether horizontal swipe gestures will trigger back-forward list navigations.
Example
Dim browser As WKWebViewMBS // your instance

browser.allowsBackForwardNavigationGestures = True

The default value is false.
(Read and Write property)

WKWebViewMBS.allowsLinkPreview as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value that determines whether pressing on a link displays a preview of the destination for the link.
Example
Dim browser As WKWebViewMBS // your instance

browser.allowsLinkPreview = True

(Read and Write property)

WKWebViewMBS.allowsMagnification as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value indicating whether magnify gestures will change the web view’s magnification.
Example
Dim browser As WKWebViewMBS // your instance

browser.allowsMagnification = True

The default value is false. You can set the magnification property even if allowsMagnification is set to false.
For MacOS 64-bit only.
(Read and Write property)

WKWebViewMBS.allowUniversalAccessFromFileURLs as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Allow universal file access for URLs.

Any file URL will be loaded if true.
Please check WebKit documentation for details.

Does not work in MacOS 10.14.
(Read and Write property)

WKWebViewMBS.backForwardList as WKWebViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The web view's back-forward list.

(Read only property)

WKWebViewMBS.backgroundColor as NSColorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The background color.
Example
Dim w As WKWebViewMBS = HTMLViewer1.WKWebViewMBS // your webviewer

w.drawsBackground = False
w.backgroundColor = NSColorMBS.clearColor

If background is not drawn and/or transparent, you may see through.
Requires also CSS to have web view page transparent.
(Read and Write property)

WKWebViewMBS.CanGoBack as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value indicating whether there is a back item in the back-forward list that can be navigated to.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "CanGoBack: "+If(Browser.CanGoBack, "yes", "no")

(Read only property)

WKWebViewMBS.CanGoForward as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value indicating whether there is a forward item in the back-forward list that can be navigated to.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "CanGoForward: "+If(Browser.CanGoForward, "yes", "no")

(Read only property)

WKWebViewMBS.Configuration as WKWebViewConfigurationMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the configuration used to initialize the WKWebView.

(Read only property)

WKWebViewMBS.customUserAgent as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The custom user agent string.
Example
Dim browser As WKWebViewMBS // your instance

browser.customUserAgent = "MyBrowser/1.0"

If no custom user agent string has been set, this is set to "".
Available in 32-bit. Available in 64-bit for macOS 10.11 or newer.
(Read and Write property)

WKWebViewMBS.developerExtrasEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether developer extras are enabled.
Example
Dim browser As WKWebViewMBS // your instance

// enable context menu entry to show developer extras
browser.developerExtrasEnabled = True

Enables the context menu to inspect items.
(Read and Write property)

WKWebViewMBS.drawsBackground as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether to draw background for the view.
Example
Dim w As WKWebViewMBS = HTMLViewer1.WKWebViewMBS // your webviewer

w.drawsBackground = False
w.backgroundColor = NSColorMBS.clearColor

If background is not drawn and/or transparent, you may see through.
Requires also CSS to have web view page transparent.
(Read and Write property)

WKWebViewMBS.EstimatedProgress as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An estimate of what fraction of the current navigation has been loaded.

This value ranges from 0.0 to 1.0 based on the total number of bytes expected to be received, including the main document and all of its potential subresources. After a navigation loading completes, the estimatedProgress remains at 1.0 until a new navigation starts, at which point the estimatedProgress is reset to 0.0.
(Read only property)

WKWebViewMBS.hasOnlySecureContent as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value indicating whether all resources on the page have been loaded through securely encrypted connections.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "hasOnlySecureContent: "+If(Browser.hasOnlySecureContent, "yes", "no")

Only set for 64-bit, always false on 32-bit.
(Read only property)

WKWebViewMBS.HTTPCookieStore as WKHTTPCookieStoreMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Convenience property to directly query HTTP cookie store for WKWebview configuration.
Example
Dim CookieStore As WKHTTPCookieStoreMBS = WKWebViewControlMBS1.WKWebView.HTTPCookieStore
Dim cookies() As NSHTTPCookieMBS = CookieStore.AllCookies
Dim cookie As NSHTTPCookieMBS = cookies(0)

// now check in debugger
Break

(Read only property)

WKWebViewMBS.IsLoading as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value indicating whether the view is currently loading content.
Example

Dim browser As WKWebViewMBS // your instance

// load a page
browser.LoadURL "https://www.mbsplugins.de/xojo"

// wait synchronously for website loading
While browser.IsLoading
DelayMBS 0.1
Wend

MsgBox "loaded"

(Read only property)

WKWebViewMBS.javaEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether java is enabled.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "JavaScript Enabled: "+If(Browser.javaEnabled, "yes", "no")

(Read and Write property)

WKWebViewMBS.javaScriptCanOpenWindowsAutomatically as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether javascript can open new windows.
Example
Dim browser As WKWebViewMBS // your instance

// disable popup windows
Browser.javaScriptCanOpenWindowsAutomatically = False

(Read and Write property)

WKWebViewMBS.javaScriptEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
JavaScript was evaluated.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "JavaScript Enabled: "+If(Browser.javaScriptEnabled, "yes", "no")

Error is only set with 64-bit, not with 32-bit.
Tag is passed from EvaluateJavaScript call.
(Read and Write property)

WKWebViewMBS.loadsImagesAutomatically as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether to load images automatically.
Example
Dim browser As WKWebViewMBS // your instance

// disable loading of images
browser.loadsImagesAutomatically = False

(Read and Write property)

WKWebViewMBS.magnification as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The factor by which the page content is currently scaled.
Example
Dim browser As WKWebViewMBS // your instance

browser.magnification = 2.0

The default value is 1.0.
For MacOS 64-bit only.
(Read and Write property)

WKWebViewMBS.mediaType as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The media type for the WKWebView.

The value of mediaType will override the normal value of the CSS media property.
Setting the value to "" will restore the normal value.
The default value is "".

Available in macOS 11.0 or newer.
(Read and Write property)

WKWebViewMBS.MIMEType as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Queries current mime type for showing document.

Should be "text/html" for a website or "application/pdf" for a PDF document.
(Read only property)

WKWebViewMBS.minimumFontSize as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The minimum font size to use.
Example
Dim browser As WKWebViewMBS // your instance

browser.minimumFontSize = 20

(Read and Write property)

WKWebViewMBS.pageZoom as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The factor by which page content is scaled relative to the viewport.

The default value is 1.0.
Changing this value is equivalent to web content setting the CSS "zoom" property on all page content.

Available in macOS 11.0 or newer.
(Read and Write property)

WKWebViewMBS.plugInsEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether plugins are enabled.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "plugInsEnabled: "+If(Browser.plugInsEnabled, "yes", "no")

(Read and Write property)

WKWebViewMBS.Preferences as WKPreferencesMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Convenience property to directly query HTTP cookie store for WKWebview preferences.

(Read only property)

WKWebViewMBS.privateBrowsing as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Whether private browsing is enabled.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox "privateBrowsing: "+If(Browser.privateBrowsing, "yes", "no")

If enabled, no data should be stored for cookies or cache on disk, so it's cleared when web viewer is destroyed.
Default is non-private mode for the web viewer.

It looks like you can't change mode after web viewer was created.
(Read and Write property)

WKWebViewMBS.Title as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The page title.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox Browser.Title

(Read only property)

WKWebViewMBS.URL as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebKit2 MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The active URL.
Example
Dim browser As WKWebViewMBS // your instance

MsgBox Browser.URL

This is the URL that should be reflected in the user interface.
(Read only property)

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


The biggest plugin in space...