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:
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
Statistic
FMM
Blog
WebView.SetPreferences
Sets WebView preferences parameters.
Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
WebView | 2.2 | Yes | No | No | No | Yes |
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 |
ParameterValue | The value for the given parameter: 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. | 0 |
Result
Returns OK or an error message.
Description
Sets WebView preferences parameters.For WebKit 1.x you can pass empty WebViewerRef to access global preferences.
Available keys for WebKit 1.x (FileMaker till version 15 and WebView.Create): 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.
Examples
set print background option:
MBS("WebView.SetPreferences"; $WebViewerRef; "shouldPrintBackgrounds", 1)
Disables image loading:
MBS("WebView.SetPreferences"; $WebViewerRef; "loadsImagesAutomatically", 0)
Disable Java:
MBS("WebView.SetPreferences"; $WebViewerRef; "javaEnabled"; 0)
Disable Plugins:
MBS("WebView.SetPreferences"; $WebViewerRef; "plugInsEnabled"; 0)
Set developer extras enabled state for webviewer to show inspector:
Set Variable [$r; Value: MBS("WebView.SetPreferences"; "web"; "developerExtrasEnabled"; 1) ]
Enable file URLs:
Set Variable [$r; Value:MBS("WebView.SetPreferences"; "web"; "allowFileAccessFromFileURLs"; 1)]
Disable web security:
MBS( "WebView.SetPreferences"; "web"; "webSecurityEnabled"; 0 )
Disable cross origin resource policy enabled:
MBS( "WebView.SetPreferences"; "web"; "CrossOriginResourcePolicyEnabled"; 1)
Enable console messages to Console.app:
Set Variable [ $r ; Value: MBS( "WebView.SetPreferences"; "web"; "logsPageMessagesToSystemConsoleEnabled"; 1 ) ]
Disable JavaScript:
MBS("WebView.SetPreferences"; $WebViewerRef; "javaScriptEnabled"; 0)
See also
- WebView.Create
- WebView.FindByName
- WebView.GetPreferences
- WebView.InstallUserMediaAccess
- WebView.RenderImage
- WebView.RenderPDF
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 10.3pr1
- MBS FileMaker Plugin, version 10.2pr7
- Automate web viewer in FileMaker
- MBS FileMaker Plugin, version 7.6pr5
- Enable Web Inspector for WebViewer
- MBS FileMaker Plugin, version 7.2pr4
- MBS Filemaker Plugin, version 2.2pr3
Release notes
- Version 10.3
- Added webSecurityEnabled and CrossOriginResourcePolicyEnabled keys for WebView.SetPreferences function.
- Version 10.2
- Added new preferences keys for WebView.SetPreferences: mediaDevicesEnabled and mediaStreamEnabled.
- Version 8.0
- Added allowUniversalAccessFromFileURLs parameter for WebView.SetPreferences.
Created 18th August 2014, last changed 19th January 2021
WebView.SetPageSizeMultiplier - WebView.SetPrintParameter
Feedback: Report problem or ask question.

Links
MBS Xojo Plugins