Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

WebView.SetPreferences

Sets WebView preferences parameters.

Component: WebView
Version: 2.2
Mac OS X: Yes
Windows: No
Server: No
FileMaker Cloud: No

MBS( "WebView.SetPreferences"; WebViewerRef; ParameterName; ParameterValue )

Parameters

Parameter Description Example value
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: 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): minimumFontSize, javaScriptEnabled, javaScriptCanOpenWindowsAutomatically, javaEnabled and plugInsEnabled.

Examples

set print background option:

MBS("WebView.SetPreferences"; $WebViewerRef; "shouldPrintBackgrounds", 1)

Disables image loading:

MBS("WebView.SetPreferences"; $WebViewerRef; "loadsImagesAutomatically", 1)

Disable Java:

MBS("WebView.SetPreferences"; $WebViewerRef; "javaEnabled"; 0)

Disable Plugins:

MBS("WebView.SetPreferences"; $WebViewerRef; "plugInsEnabled"; 0)

See also


WebView.SetFormValue   -   WebView.SetPrintParameter

Feedback: Report problem or ask question.




Links
MBS Realbasic Plugins - Nachhilfe in Kell