Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WebView.GetPreferences

Queries WebView preferences parameters.

Component Version macOS Windows Linux Server iOS SDK
WebView 2.2 ✅ Yes ✅ Yes ❌ No ❌ No ✅ Yes
MBS( "WebView.GetPreferences"; WebViewerRef; ParameterName )   More

Parameters

Parameter Description Example
WebViewerRef Either the Web Viewer Object Name or the Web Viewer ID as returned by "WebView.FindByName" function. "web"
ParameterName The name of the parameter. isJavaEnabled

Result

Returns a boolean value for allowsAnimatedImageLooping, allowsAnimatedImages, javaEnabled, javaScriptCanOpenWindowsAutomatically, javaScriptEnabled, loadsImagesAutomatically, plugInsEnabled, privateBrowsingEnabled, shouldPrintBackgrounds, tabsToLinks, userStyleSheetEnabled and usesPageCache; a number for cacheModel, defaultFixedFontSize, defaultFontSize, minimumFontSize or minimumLogicalFontSize; a string for cursiveFontFamily, defaultTextEncodingName, fantasyFontFamily, fixedFontFamily, sansSerifFontFamily, serifFontFamily or standardFontFamily.

Description

Queries WebView preferences parameters.
For WebKit 1.x you can pass empty WebViewerRef to access global preferences.

Available keys for WebKit 1.x: allowsAnimatedImageLooping, allowsAnimatedImages, cacheModel, cursiveFontFamily, defaultFixedFontSize, defaultFontSize, defaultTextEncodingName, fantasyFontFamily, fixedFontFamily, javaEnabled, javaScriptCanOpenWindowsAutomatically, javaScriptEnabled, loadsImagesAutomatically, minimumFontSize, minimumLogicalFontSize, plugInsEnabled, privateBrowsingEnabled, sansSerifFontFamily, serifFontFamily, shouldPrintBackgrounds, standardFontFamily, tabsToLinks, userStyleSheetEnabled or usesPageCache.

Available keys for WebKit 2.x (FileMaker 16): developerExtrasEnabled, logsPageMessagesToSystemConsoleEnabled, minimumFontSize, javaScriptEnabled, javaScriptCanOpenWindowsAutomatically, telephoneNumberDetectionIsEnabled, javaEnabled and plugInsEnabled.

New in version 10.2: mediaDevicesEnabled and mediaStreamEnabled to allow camera/microphone/screen access.
New in version 10.3: CrossOriginResourcePolicyEnabled and webSecurityEnabled to enable cross site scripting.

Please check WebKit documentation for details.

Implemented for Windows with Microsoft Edge/Chrome engine in MBS Plugin 11.5 when using FileMaker Pro 19.4 or newer.
Possible keys: IsScriptEnabled, IsWebMessageEnabled, AreDefaultScriptDialogsEnabled, IsStatusBarEnabled, AreDevToolsEnabled, AreDefaultContextMenusEnabled, AreHostObjectsAllowed, IsZoomControlEnabled, IsBuiltInErrorPageEnabled, areBrowserAcceleratorKeysEnabled, IsPinchZoomEnabled, IsPasswordAutosaveEnabled and IsGeneralAutofillEnabled.

MBS Plugin 11.5 adds fraudulentWebsiteWarningEnabled for macOS 10.15 and iOS 13.0 to check whether the warnings or fraudulent websites is enabled. The textInteractionEnabled setting in macOS 12.0 and iOS 15.0 allows to check whether text interactions are enabled.

Added IsSwipeNavigationEnabled and HiddenPdfToolbarItems options in version 14.2 for Windows using WebView 2.

Examples

Queries setting for background printing:

MBS("WebView.GetPreferences"; "shouldPrintBackgrounds")

Query developer extras enabled state for WebViewer:

Set Variable [$r; Value:MBS("Webview.GetPreferences"; "web"; "developerExtrasEnabled")]

Set developer extras enabled state for WebViewer:

Set Variable [$r; Value:MBS("WebView.SetPreferences"; "web"; "developerExtrasEnabled"; 1)]

Check whether pinch zoom is enabled:

MBS( "WebView.GetPreferences"; "web"; "IsPinchZoomEnabled")

See also

Release notes

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 11st April 2024


WebView.GetPlainText - WebView.GetPrintParameter