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](component_WebView.md) | [2.7](newinversion27.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "WebPolicyDelegate.Install"; WebViewerRef ) 

**MBS**( **"WebPolicyDelegate.Install";** /\* Assigns this WebViewer our policy delegate as a filter to the FileMaker built in delegate. \*/  
**$WebViewerRef**) /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" 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](WebViewCreate.md)).  
### Examples

Makes sure all PDF files are downloaded:

 MBS ( "[WebDownloadDelegate.Install](WebDownloadDelegateInstall.md)" ; "web" )  
MBS ( "[WebPolicyDelegate.AddMimeType](WebPolicyDelegateAddMimeType.md)"; "application/pdf"; "download" )  
### See also

- [WebDownloadDelegate.Install](WebDownloadDelegateInstall.md)
- [WebPolicyDelegate.AddMimeType](WebPolicyDelegateAddMimeType.md)
- [WebView.Create](WebViewCreate.md)
- [WebView.FindByName](WebViewFindByName.md)

This function checks for a license.

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

  
[WebPolicyDelegate.AddMimeType](WebPolicyDelegateAddMimeType.md) - [WebPolicyDelegate.RemoveMimeType](WebPolicyDelegateRemoveMimeType.md)

[HTML Version](WebPolicyDelegateInstall.shtml)