WebDownloadDelegate.Install
---------------------------

Assigns this web viewer our download delegate.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebDownloadDelegate](component_WebDownloadDelegate.md) | [2.7](newinversion27.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "WebDownloadDelegate.Install" { ; WebViewerRef } ) 

**MBS**( **"WebDownloadDelegate.Install";** /\* Assigns this web viewer our download delegate. \*/  
**$WebViewerRef**) /\* Optional; Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function.  
Only needed for WebKit 1! \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function.   Only needed for WebKit 1! |  | Optional |

### Result

Returns OK on success or error.

### Description

Assigns this web viewer our download delegate.  
This needs to made whenever you want to receive download script calls for a web viewer.  
If web viewer is part of a data record in FileMaker, you may need to set it for each record whenever a record is loaded.  
  
Implemented for WebKit 2.x in v13.4.  
### Examples

Makes sure all PDF files are downloaded:

 MBS ( "WebDownloadDelegate.Install" ; "web" )  
MBS ( "[WebPolicyDelegate.AddMimeType](WebPolicyDelegateAddMimeType.md)"; "application/pdf"; "download" )  
Install for WebKit 2:

 # must run before web viewer is created   
Set Variable \[ $r ; Value: MBS ("WebDownloadDelegate.Install") \]  
### See also

- [WebDownloadDelegate.Cancel](WebDownloadDelegateCancel.md)
- [WebDownloadDelegate.GetFolder](WebDownloadDelegateGetFolder.md)
- [WebDownloadDelegate.MIMEType](WebDownloadDelegateMIMEType.md)
- [WebDownloadDelegate.Path](WebDownloadDelegatePath.md)
- [WebDownloadDelegate.SetFolder](WebDownloadDelegateSetFolder.md)
- [WebPolicyDelegate.AddMimeType](WebPolicyDelegateAddMimeType.md)
- [WebPolicyDelegate.Install](WebPolicyDelegateInstall.md)
- [WebView.FindByName](WebViewFindByName.md)

### Example Databases

- [WebViewer/WebViewer Download Delegate for Mac](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Download%20Delegate%20for%20Mac.shtml#6ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 26th August 2023

  
[WebDownloadDelegate.GetFolder](WebDownloadDelegateGetFolder.md) - [WebDownloadDelegate.MIMEType](WebDownloadDelegateMIMEType.md)

[HTML Version](WebDownloadDelegateInstall.shtml)