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

WebPolicyDelegate.Install

Assigns this WebViewer our policy delegate as a filter to the FileMaker built in delegate.

Component Version macOS Windows Linux Server iOS SDK
WebView 2.7 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "WebPolicyDelegate.Install"; WebViewerRef )   More

Parameters

Parameter Description Example
WebViewerRef Either the Web Viewer Object Name or the Web Viewer ID as returned by "WebView.FindByName" function.

Result

Returns OK on success or error.

Description

Assigns this WebViewer our policy delegate as a filter to the FileMaker built in delegate.
When using our WebDownloadDelegate, you may see that it prefers to show a PDF with the build in PDF Viewer rather than downloading it. This set of functions serves to fix on problem: Getting the WebViewer to download files instead of showing them.
So you can for example register that PDF files (mime type "application/pdf") are downloaded instead of viewed.
All other policy things are forwarded to normal FileMaker policy delegate. And the plugin makes sure you don't install the policy delegate twice.

Not supported for WebKit 2.x (FileMaker 16 Mac), but may work with plugin made web viewers (see WebView.Create).

Examples

Makes sure all PDF files are downloaded:

MBS( "WebDownloadDelegate.Install" ; "web" )
MBS( "WebPolicyDelegate.AddMimeType"; "application/pdf"; "download" )

See also

This function checks for a license.

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


WebPolicyDelegate.AddMimeType - WebPolicyDelegate.RemoveMimeType