When using WKWebViewControlMBS control in your Xojo projects, you can use WebKit 1.x (32-bit) and WebKit 2.x (64-bit) transparently. Depending on the bit setting of your Mac application, the plugin uses either the newer or older classes from WebKit.
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 didReceiveScriptMessage event in our control. So we implement an event to show via msgbox what we got:
Sub didReceiveScriptMessage(Body as Variant, name as String)