Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  

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.

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 paid license.

Created 18th August 2014, last changed 4th November 2021


WebView.GetPlainText - WebView.GetPrintParameter

💬 Ask a question or report a problem


Start Chat