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.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5   10.0    Statistic  


Adds a script message handler.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
WebView 8.0 Yes No No No Yes
MBS( "WebView.AddScriptMessageHandler"; Name )   More


Parameter Description Example value
Name The name of the message handler. "test"


Returns OK or error.


Adds a script message handler.
Adding a script message handler with name name causes the JavaScript function to be defined in all frames in all web views that use the user content controller.
Only for FileMaker 16 and newer.

Trigger script in FileMaker from JavaScript:

window.webkit.messageHandlers.test.postMessage({'filename':'WebView Message Handler.fmp12', 'parameter':'Hello World from JavaScript', 'scriptName':'test'});

Evaluate expression in JavaScript:

window.webkit.messageHandlers.test.postMessage({'evaluate':'MBS( "Msgbox"; "Hello from Evaluate in JavaScript" )'});

Added iOS for version 9.5.


Add script handler:

Set Variable [ $r ; Value: MBS( "WebView.AddScriptMessageHandler"; "test" ) ]

See also

Blog Entries

Release notes

Created 15th December 2017, last changed 5th January 2020

WebPolicyDelegate.RemoveMimeType   -   WebView.AddUserScript

Feedback: Report problem or ask question.

MBS Xojo tutorial videos