As you may know FileMaker 16 on macOS uses WebKit 2.x, so our old WebView.InstallCallback function broke. We got a workaround using WebView.Create for creating WebKit 1.x web viewers in FileMaker 16 and using older WebKit functions.

Now we have a new way for WebKit 2.x using a JavaScript bridging. With macOS 10.10 (and iOS 8.0) Apple introduced the ability to install custom JavaScript message handlers for WKWebView. We just added them for our plugins to call back from JavaScript to FileMaker scripts.
First you call Webview.AddScriptMessageHandler function to register a name:

As you see, we get for our message handler a new entry in the namespace called window.webkit.messageHandlers.test. This allows us to call postMessage method there and this triggers the plugin code to trigger scripts or do evaluation. The parameter to the postMessage must be a Javascript object with a few properties:

fileName: The name of the file with the script.

scriptName: The name of the script to trigger.

parameter: The parameter to pass to the script.

evaluate: The expression to evaluation.

This works nice in first tests and we'd love to see what you can do with this technique. Please try with next prerelease or email us for a copy today.