Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
CSS3 Selector of the Event Target HTML5 Element.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
The name of the Event.
Set True for Event Bubbling.
Set True if Event can be cancelled.
Set True if Event is Composed.
Event Data passed as OLE/COM Variant which is converted to V8 JavaScript Value.
If True then the event cannot be cancelled which results in better performance between the ActiveX and Chromium engine.
This affects the Interprocess Communication Protocol between the ActiveX and Chromium. Read remarks section for more information.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
Visual Basic |
---|
Public Function DispatchEvent( _ ByVal TargetSelector As String, _ ByVal EventName As String, _ ByVal Bubbles As Boolean, _ ByVal Cancelable As Boolean, _ ByVal Composed As Boolean, _ ByVal Detail As Variant, _ ByVal ImmutableEvent As Boolean _ ) As Variant |
CSS3 Selector of the Event Target HTML5 Element.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
The name of the Event.
Set True for Event Bubbling.
Set True if Event can be cancelled.
Set True if Event is Composed.
Event Data passed as OLE/COM Variant which is converted to V8 JavaScript Value.
If True then the event cannot be cancelled which results in better performance between the ActiveX and Chromium engine.
This affects the Interprocess Communication Protocol between the ActiveX and Chromium. Read remarks section for more information.
Result of JavaScript Event Handler.
WebKitX DispatchEvent() method allows you to fire DOM events directly into HTML5 and handle those events by JavaScript event handlers. You can pass the target selector that will receive the event, the event name, event initialization parameters (bubbling, cancelable, composed) and an OLE/COM Variant that will be converted into a V8 JavaScript object and added in the details field of the Event object. Event execution can be both synchronous and asynchronous in terms of IPC tunneling, and it is always synchronous in terms of DOM.
Unlike "native" events, which are fired by the DOM and invoke event handlers asynchronously via the event loop, dispatchEvent invokes event handlers synchronously. All applicable event handlers will execute and return before the code continues on after the call to dispatchEvent.
The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Private Sub mnuTestDispatchEvent_Click() On Error Resume Next Dim s As String Dim result As Boolean s = InputBox("Selector", , "body") If s = "" Then Exit Sub result = WebKitX1.DispatchEvent(s, "my_event", True, True, True, Array("My Data", 10, 3.14, Date + Time), True) MsgBox result, vbInformation End Sub
private void menuItemTestDispatchEvent_Click(object sender, EventArgs e) { string input = Microsoft.VisualBasic.Interaction.InputBox("Selector", "HTML5 Pad", "Body", 500, 300); if (input != "") { object result = WebKitXCEF31.DispatchEvent(input, "my_event", true, true, true, new object[] { "My Data", 10, "3.14" }, true); MessageBox.Show(result.ToString(), "HTML5 Pad", MessageBoxButtons.OK, MessageBoxIcon.Information); } }