If you take a close look on the WebView.SetPreferences function for MacOS and iOS, you find a couple of options to set. Let's take a look on the most important options and what each option sets:
You may load some HTML into the web viewer, like the content of an email. Since you don't know the font sizes, you can define a minimum font size for the content.
For example use 12 point for fonts as minimum:
Set Variable [$r; Value: MBS("WebView.SetPreferences"; "web"; "minimumFontSize"; 12) ]
In your scripts you can enable developer extras. This allows you to open the inspector via contextual mouse menus. As you can define this by script, you may want to enable it, if the current account privilege set is Full Access.
You can enable developer extras like this:
Set Variable [$r; Value: MBS("WebView.SetPreferences"; "web"; "developerExtrasEnabled"; 1) ]
You can enable logging console messages from a web page to the system console.
First you enable the setting:
Set Variable [ $r ; Value: MBS( "WebView.SetPreferences"; "web"; "logsPageMessagesToSystemConsoleEnabled"; 1 ) ]
This shows in inspector and in Console.app you may look for messages and find something like this:
15467 standard 21:58:14.818259+0100 com.apple.WebKit.WebContent https://www.mbs-plugins.com/:1:12: CONSOLE LOG Hello world!
When loading HTML you don't know about, it may refer to external images on some servers. By loading the images, you may reveal that you got the html and get tracked. This is often used for emails to track who received and opened the email.
Disable loading images automatically:
Set Variable [$r; Value: MBS("WebView.SetPreferences"; $WebViewerRef; "loadsImagesAutomatically", 0) ]
You can define whether text detector should check the html shown and detect phone numbers. If phone numbers are found, they show like links, so the user can click on them to call. This is very useful when showing emails which may contain contact information.
Enable phone number detection:
Set Variable [$r; Value: MBS("WebView.SetPreferences"; $WebViewerRef; "telephoneNumberDetectionIsEnabled", 0) ]
mediaStreamEnabled and mediaDevicesEnabled
You can allow media streaming for the web viewer. And you can allow media device access to camera, screen and microphone. Then you can use software for screen sharing and telephoning within FileMaker on recent macOS versions.
See WebView.InstallUserMediaAccess function for details.
webSecurityEnabled and CrossOriginResourcePolicyEnabled
e.g. disable cross origin policy:
Set Variable [$r; Value: MBS( "WebView.SetPreferences"; "web"; "CrossOriginResourcePolicyEnabled"; 0) ]
For all Web Viewer you like to control via plugin, please make sure you have an URL loaded. Minimum would be "about:blank" for a white page. Until something is loaded, FileMaker defers creating the web viewer and the plugin can't find it.
Please do not hesitate to contact us with your questions.