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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Adds a user script.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WebView | 9.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
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 |
Returns OK or error.
Add a test script:
MBS( "Webview.AddUserScript"; "web"; "alert('Hello');"; "AtDocumentEnd"; 1 )
This function checks for a license.
Created 8th November 2019, last changed 5th January 2020