Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
WebView.AddUserScript
Adds a user script.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| WebView | 9.5 | Yes | No | No | No | Yes |
MBS( "WebView.AddUserScript"; WebViewerRef; Source; injectionTime; forMainFrameOnly ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "WebView.FindByName" function. | |
| Source | The source code. | |
| injectionTime | The time when the script should be injected into the webpage. AtDocumentStart: Inject the script after the document element is created, but before any other content is loaded. AtDocumentEnd: Inject the script after the document finishes loading, but before other subresources finish loading. |
"AtDocumentEnd" |
| forMainFrameOnly | A Boolean value indicating whether the script should be injected only into the main frame (true) or into all frames (false). | 1 |
Result
Returns OK or error.
Description
Adds a user script.Only for FileMaker 16 and newer in WebKit 2.x web viewer on Mac and iOS.
Examples
Add a test script:
MBS( "WebView.AddUserScript"; "web"; "alert('Hello');"; "AtDocumentEnd"; 1 )
See also
Blog Entries
- MBS FileMaker Plugin, version 9.6pr3
- New functions of the MBS Plugin Version 9.5
- Neues MBS FileMaker Plugin 9.5
- MBS FileMaker Plugin 9.5 - More than 5900 Functions In One Plugin
- MBS FileMaker Plugin, version 9.5pr8
Release notes
- Version 10.0
- Fixed memory leak in WebView.AddUserScript function.
- Version 9.5
- Added Webview.AddUserScript, Webview.UserScripts and Webview.RemoveAllUserScripts functions.
Created 8th November 2019, last changed 5th January 2020
WebView.AddScriptMessageHandler - WebView.AllCookies
Feedback: Report problem or ask question.
Links
MBS FileMaker Plugins