Fired when you execute in JavaScript the window.postComMessage(value) function in order to pass values from JavaScript to your application.
An OLE/COM Variant returned from the JavaScript context by calling window.postComMessage function.
When you call window.postComMessage function you can pass arbitrary scalar JavaScript values which are converted to Strings (BSTR).
postComMessage |
Copy Code |
---|---|
window.postComMessage(5); window.postComMessage(3.14); window.postComMessage("Hello World!"); window.postComMessage(new Date()); window.postComMessage(true); window.postComMessage(5, 3.14, "Hello World", new Date(), true); |
Fired when you execute in JavaScript the window.postComMessage(value) function in order to pass values from JavaScript to your application.
Visual Basic |
---|
Public Event OnComPostMessage( _ ByRef Params As Variant _ ) |
An OLE/COM Variant returned from the JavaScript context by calling window.postComMessage function.
When you call window.postComMessage function you can pass arbitrary scalar JavaScript values which are converted to Strings (BSTR).
postComMessage |
Copy Code |
---|---|
window.postComMessage(5); window.postComMessage(3.14); window.postComMessage("Hello World!"); window.postComMessage(new Date()); window.postComMessage(true); window.postComMessage(5, 3.14, "Hello World", new Date(), true); |
WebKitX implements a bi-directional mechanism for sending data from your application to JavaScript and from JavaScript to your application.
To sent data from your application to JavaScript you can use:
To send data from JavaScript to your application you can use:
<html> <head> <script> function notify(param) { window.postComMessage(param); } </script> </head> <body> <br><br><button onclick="notify('Hello from WebKitX')">Post COM Message with String</button> <br><br><button onclick="notify(5)">Post COM Message with Integer</button> <br><br><button onclick="notify(3.1415)">Post COM Message with Double</button> <br><br><button onclick="notify(new Date())">Post COM Message with Date</button> <br><br><button onclick="notify(true)">Post COM Message with Boolean</button> </body> </html>
Private Sub WebKitX1_OnComPostMessage(Params As Variant) On Error Resume Next ' Message originated from window.postComMessage() in JavaScript AddLog "OnComPostMessage: " & Params End Sub
private void WebKitXCEF31_OnComPostMessage(object sender, AxWebKitXCEF3Lib._DWebKitXCEF3Events_OnComPostMessageEvent e) { AddLog("OnComPostMessage: " + e.@params); }