Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5    Statistic  

Webview.AddUserScript

Adds a user script.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Webview 9.5 Yes No No No Yes
MBS( "Webview.AddUserScript"; WebViewerRef; Source; injectionTime; forMainFrameOnly )   More

Parameters

Parameter Description Example value
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

Created 8th November 2019, last changed 8th November 2019


Webview.AddScriptMessageHandler   -   Webview.AllCookies

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins