WebView.Close
-------------

Closes a custom web view.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [7.4](newinversion74.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.Close"; WebViewerRef ) 

**MBS**( **"WebView.Close";** /\* Closes a custom web view. \*/  
**$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 or error.

### Description

Closes a custom web view.  
Only for web viewer created with [WebView.Create](WebViewCreate.md).  
  
Added iOS support for version 10.3.  
### Examples

Close WebViewer:

 If \[ Length($$web ) &gt; 0 \]   
 Set Variable \[ $r ; Value: MBS ("Webview.Close"; $$web ) \]   
 Set Variable \[ $$web ; Value: "" \]   
End If  
### See also

- [WebView.Copy](WebViewCopy.md)
- [WebView.Create](WebViewCreate.md)
- [WebView.FindByName](WebViewFindByName.md)

### Release notes

- **Version 16.3**
    - Improved WebView.Close to close the WebView window.
- **Version 7.4**
    - Added [WebView.Close](http://www.mbsplugins.eu/WebViewClose.shtml) function.

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#9ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr3](https://www.mbsplugins.de/archive/2026-06-22/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Working on WebViewer memory leaks](https://www.mbsplugins.de/archive/2020-11-09/Working_on_WebViewer_memory_le/monkeybreadsoftware_blog_filemaker)
- [WebViewer on Popover with MBS Plugin](https://www.mbsplugins.de/archive/2018-02-16/WebViewer_on_Popover_with_MBS_/monkeybreadsoftware_blog_filemaker)
- [Print WebViewer on macOS in FileMaker](https://www.mbsplugins.de/archive/2017-11-28/Print_WebViewer_on_macOS_in_Fi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.4pr5](https://www.mbsplugins.de/archive/2017-09-11/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin Schulung auf Deutsch bei der FMK 2017](https://www.mbsplugins.de/archive/2017-09-11/MBS_FileMaker_Plugin_Schulung_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th September 2017 , last changed 4th November 2021

  
[WebView.ClickInput](WebViewClickInput.md) - [WebView.Cookies.ClearForURL](WebViewCookiesClearForURL.md)

[HTML Version](WebViewClose.shtml)