WebView.UserScripts
-------------------

Queries list of user scripts.

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

MBS( "WebView.UserScripts"; WebViewerRef ) 

**MBS**( **"WebView.UserScripts";** /\* Queries list of user scripts. \*/  
**$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 JSON or error.

### Description

Queries list of user scripts.  
Returns JSON array of objects with three fields for each script: source, injectionTime and forMainFrameOnly.  
injectionTime is either AtDocumentStart or AtDocumentEnd.  
forMainFrameOnly is a boolean value.  
### Examples

Query user scripts:

 MBS ( "Webview.UserScripts"; "web" )  
<small>  
Example result:   
\[ { "forMainFrameOnly" : true, "source" : "alert('Hello');" , "injectionTime" : "AtDocumentEnd" } \] </small>### See also

- [WebView.AddUserScript](WebViewAddUserScript.md)
- [WebView.FindByName](WebViewFindByName.md)

### Release notes

- **Version 9.5**
    - Added [Webview.AddUserScript](http://www.mbsplugins.eu/WebviewAddUserScript.shtml), [Webview.UserScripts](http://www.mbsplugins.eu/WebviewUserScripts.shtml) and [Webview.RemoveAllUserScripts](http://www.mbsplugins.eu/WebviewRemoveAllUserScripts.shtml) functions.

### Blog Entries

- [New functions of the MBS Plugin Version 9.5](https://www.mbsplugins.de/archive/2019-11-21/New_functions_of_the_MBS_Plugi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.5pr8](https://www.mbsplugins.de/archive/2019-11-08/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 8th November 2019 , last changed 5th January 2020

  
[WebView.StopLoading](WebViewStopLoading.md) - [WebView.Version](WebViewVersion.md)

[HTML Version](WebviewUserScripts.shtml)