WebView.FindByName
------------------

Returns a unique ID that references a the web viewer.

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

MBS( "WebView.FindByName"; WindowRef; WebViewerObjectName ) 

**MBS**( **"WebView.FindByName";** /\* Returns a unique ID that references a the web viewer. \*/  
**$WindowRef**; /\* Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window.e.g. 0 \*/   
**$WebViewerObjectName**) /\* The name of the Web Viewer as set in the object info palette.e.g. "web" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window. | 0 |
| WebViewerObjectName | The name of the Web Viewer as set in the object info palette. | "web" |

### Description

Returns a unique ID that references a the web viewer.   
This function is used by all the other functions to target the correct web viewer. This function requires the WindowRef that is returned by the [WebView.FindWindowByTitle](WebViewFindWindowByTitle.md) function. Known Issues: In FileMaker 9, the WebView control must have the Display Progress Bar and Display Status Messages check boxes set to "unchecked" FileMaker 8,Windows PC only. The WebView Control can not be set to have "zero" line width on it's border. With the release of 1.4 this function became optional. You can now access a WebViewer by its name. But this is still useful in some scenarios. If you are trying to get a handle on WebViewer that is displayed in List mode, you must use this method.  
The WebViewer reference is only valid until FileMaker destroys the WebViewer. So better search again when you move to a new record or change the window.  
  
The WebViewer must have content to be found. If you don't load a page, you should still put an "about:blank" URL there.  
  
You may need to have a script pause for FileMaker to create the web viewer after a layout change. If you use Freeze Window command, the layout may not be drawn and thus the plugin may not find the web viewer.  
### Examples

Find the Web View ID

 Let(  
\[  
WebViewerName = "web";  
WindowRef = MBS ("[Window.FindByTitle](WindowFindByTitle.md)"; Get(WindowName))  
\];  
  
MBS ("WebView.FindByName"; WindowRef; WebViewerName)  
  
)  
Find Webviewer in current window:

 MBS ("WebView.FindByName"; Get(WindowName); "web")  
### See also

- [Webview.GetDefaultDownloadFolderPath](WebviewGetDefaultDownloadFolderPath.md)
- [Webview.GetProfilePath](WebviewGetProfilePath.md)
- [Webview.SetDefaultDownloadFolderPath](WebviewSetDefaultDownloadFolderPath.md)
- [WebView.SetZoom](WebViewSetZoom.md)
- [WebView.ShowDevTools](WebViewShowDevTools.md)
- [WebView.StopLoading](WebViewStopLoading.md)
- [WebView.UserScripts](WebViewUserScripts.md)
- [WebView.Version](WebViewVersion.md)
- [WebView.ZoomPageIn](WebViewZoomPageIn.md)
- [WebView.ZoomPageOut](WebViewZoomPageOut.md)

### Release notes

- **Version 13.2**
    - Fixed [WebView.FindByName](https://www.mbsplugins.eu/WebViewFindByName.shtml) function to find web viewer better on other windows for macOS.
- **Version 9.5**
    - Fixed problem with [WebView.FindByName](http://www.mbsplugins.eu/WebViewFindByName.shtml) function not finding right web viewer on MacOS.
- **Version 9.1**
    - Changed [WebView.FindByName](http://www.mbsplugins.eu/WebViewFindByName.shtml) to better find web viewer.
    - Fixed bug in [WebView.FindByName](http://www.mbsplugins.eu/WebViewFindByName.shtml) for Mac.

### Example Databases

- [WebViewer/Disable Javascript alerts on Webviewer Mac](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Disable%20Javascript%20alerts%20on%20Webviewer%20Mac.shtml#1ScriptAnchor_)
- [WebViewer/Form Fields/Benchmark](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Form%20Fields/Benchmark.shtml#1ScriptAnchor_)
- [WebViewer/Form Fields/Forms Sample](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Form%20Fields/Forms%20Sample.shtml#1295FieldAnchor_)
- [WebViewer/Form Fields/WebViewer Forms](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Form%20Fields/WebViewer%20Forms.shtml#1295FieldAnchor_)

### Blog Entries

- [Printing a WebViewer in FileMaker](https://www.mbsplugins.de/archive/2024-02-16/Printing_a_WebViewer_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr4](https://www.mbsplugins.de/archive/2023-04-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.5pr7](https://www.mbsplugins.de/archive/2019-11-07/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Web viewer exists only with URL loaded](https://www.mbsplugins.de/archive/2019-08-27/Web_viewer_exists_only_with_UR/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr4](https://www.mbsplugins.de/archive/2019-02-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr1](https://www.mbsplugins.de/archive/2019-02-06/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2024, Seite 30](https://filemaker-magazin.de/neuigkeit/4263-Appetithappen-FMM_202403)
- Ausgabe 1/2008, Seite 32

This function checks for a license.

Created 18th August 2014 , last changed 16th January 2023

  
[WebView.FaviconURI](WebViewFaviconURI.md) - [WebView.FindWindowByIndex](WebViewFindWindowByIndex.md)

[HTML Version](WebViewFindByName.shtml)