-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebContentsEventType.hx
360 lines (332 loc) · 9.97 KB
/
WebContentsEventType.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
package eventtypes.electron;
/**
Auto generated from electron 2.0.2 api docs.
**/
enum abstract WebContentsEventType(String) to String
#if hxnodejs to js.node.events.EventEmitter.Event<haxe.Constraints.Function> #end
{
/**
Emitted when the navigation is done, i.e. the spinner of the tab has
stopped spinning, and the onload event was dispatched.
**/
var DidFinishLoad = "did-finish-load";
/**
This event is like did-finish-load but emitted when the load failed or
was cancelled, e.g. window.stop() is invoked. The full list of error
codes and their meaning is available here.
Returns:
- `event` Event
- `errorCode` Integer
- `errorDescription` String
- `validatedURL` String
- `isMainFrame` Boolean
**/
var DidFailLoad = "did-fail-load";
/**
Emitted when a frame has done navigation.
Returns:
- `event` Event
- `isMainFrame` Boolean
**/
var DidFrameFinishLoad = "did-frame-finish-load";
/**
Corresponds to the points in time when the spinner of the tab started
spinning.
**/
var DidStartLoading = "did-start-loading";
/**
Corresponds to the points in time when the spinner of the tab stopped
spinning.
**/
var DidStopLoading = "did-stop-loading";
/**
Emitted when details regarding a requested resource are available.
status indicates the socket connection to download the resource.
Returns:
- `event` Event
- `status` Boolean
- `newURL` String
- `originalURL` String
- `httpResponseCode` Integer
- `requestMethod` String
- `referrer` String
- `headers` Object
- `resourceType` String
**/
var DidGetResponseDetails = "did-get-response-details";
/**
Emitted when a redirect is received while requesting a resource.
Returns:
- `event` Event
- `oldURL` String
- `newURL` String
- `isMainFrame` Boolean
- `httpResponseCode` Integer
- `requestMethod` String
- `referrer` String
- `headers` Object
**/
var DidGetRedirectRequest = "did-get-redirect-request";
/**
Emitted when the document in the given frame is loaded.
Returns:
- `event` Event
**/
var DomReady = "dom-ready";
/**
Emitted when page receives favicon urls.
Returns:
- `event` Event
- `favicons` String
**/
var PageFaviconUpdated = "page-favicon-updated";
/**
Emitted when the page requests to open a new window for a url. It could
be requested by window.open or an external link like <a
target='_blank'>. By default a new BrowserWindow will be created for
the url. Calling event.preventDefault() will prevent Electron from
automatically creating a new BrowserWindow. If you call
event.preventDefault() and manually create a new BrowserWindow then you
must set event.newGuest to reference the new BrowserWindow instance,
failing to do so may result in unexpected behavior. For example:
Returns:
- `event` Event
- `url` String
- `frameName` String
- `disposition` String
- `options` Object
- `additionalFeatures` String
**/
var NewWindow = "new-window";
/**
Emitted when a user or the page wants to start navigation. It can
happen when the window.location object is changed or a user clicks a
link in the page. This event will not emit when the navigation is
started programmatically with APIs like webContents.loadURL and
webContents.back. It is also not emitted for in-page navigations, such
as clicking anchor links or updating the window.location.hash. Use
did-navigate-in-page event for this purpose. Calling
event.preventDefault() will prevent the navigation.
Returns:
- `event` Event
- `url` String
**/
var WillNavigate = "will-navigate";
/**
Emitted when a navigation is done. This event is not emitted for
in-page navigations, such as clicking anchor links or updating the
window.location.hash. Use did-navigate-in-page event for this purpose.
Returns:
- `event` Event
- `url` String
**/
var DidNavigate = "did-navigate";
/**
Emitted when an in-page navigation happened. When in-page navigation
happens, the page URL changes but does not cause navigation outside of
the page. Examples of this occurring are when anchor links are clicked
or when the DOM hashchange event is triggered.
Returns:
- `event` Event
- `url` String
- `isMainFrame` Boolean
**/
var DidNavigateInPage = "did-navigate-in-page";
/**
Emitted when a beforeunload event handler is attempting to cancel a
page unload. Calling event.preventDefault() will ignore the
beforeunload event handler and allow the page to be unloaded.
Returns:
- `event` Event
**/
var WillPreventUnload = "will-prevent-unload";
/**
Emitted when the renderer process crashes or is killed.
Returns:
- `event` Event
- `killed` Boolean
**/
var Crashed = "crashed";
/**
Emitted when a plugin process has crashed.
Returns:
- `event` Event
- `name` String
- `version` String
**/
var PluginCrashed = "plugin-crashed";
/**
Emitted when webContents is destroyed.
**/
var Destroyed = "destroyed";
/**
Emitted before dispatching the keydown and keyup events in the page.
Calling event.preventDefault will prevent the page keydown/keyup events
and the menu shortcuts. To only prevent the menu shortcuts, use
setIgnoreMenuShortcuts:
Returns:
- `event` Event
- `input` Object
**/
var BeforeInputEvent = "before-input-event";
/**
Emitted when DevTools is opened.
**/
var DevtoolsOpened = "devtools-opened";
/**
Emitted when DevTools is closed.
**/
var DevtoolsClosed = "devtools-closed";
/**
Emitted when DevTools is focused / opened.
**/
var DevtoolsFocused = "devtools-focused";
/**
Emitted when failed to verify the certificate for url. The usage is the
same with the certificate-error event of app.
Returns:
- `event` Event
- `url` String
- `error` String
- `certificate` Certificate
- `callback` Function
**/
var CertificateError = "certificate-error";
/**
Emitted when a client certificate is requested. The usage is the same
with the select-client-certificate event of app.
Returns:
- `event` Event
- `url` URL
- `certificateList` Certificate
- `callback` Function
**/
var SelectClientCertificate = "select-client-certificate";
/**
Emitted when webContents wants to do basic auth. The usage is the same
with the login event of app.
Returns:
- `event` Event
- `request` Object
- `authInfo` Object
- `callback` Function
**/
var Login = "login";
/**
Emitted when a result is available for [webContents.findInPage]
request.
Returns:
- `event` Event
- `result` Object
**/
var FoundInPage = "found-in-page";
/**
Emitted when media starts playing.
**/
var MediaStartedPlaying = "media-started-playing";
/**
Emitted when media is paused or done playing.
**/
var MediaPaused = "media-paused";
/**
Emitted when a page's theme color changes. This is usually due to
encountering a meta tag:
Returns:
- `event` Event
- `color` [{collection: false,typeName: String},{collection: false,typeName: null}]
**/
var DidChangeThemeColor = "did-change-theme-color";
/**
Emitted when mouse moves over a link or the keyboard moves the focus to
a link.
Returns:
- `event` Event
- `url` String
**/
var UpdateTargetUrl = "update-target-url";
/**
Emitted when the cursor's type changes. The type parameter can be
default, crosshair, pointer, text, wait, help, e-resize, n-resize,
ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize,
ns-resize, ew-resize, nesw-resize, nwse-resize, col-resize, row-resize,
m-panning, e-panning, n-panning, ne-panning, nw-panning, s-panning,
se-panning, sw-panning, w-panning, move, vertical-text, cell,
context-menu, alias, progress, nodrop, copy, none, not-allowed,
zoom-in, zoom-out, grab, grabbing or custom. If the type parameter is
custom, the image parameter will hold the custom cursor image in a
NativeImage, and scale, size and hotspot will hold additional
information about the custom cursor.
Returns:
- `event` Event
- `type` String
- `image` NativeImage
- `scale` Float
- `size` Size
- `hotspot` Point
**/
var CursorChanged = "cursor-changed";
/**
Emitted when there is a new context menu that needs to be handled.
Returns:
- `event` Event
- `params` Object
**/
var ContextMenu = "context-menu";
/**
Emitted when bluetooth device needs to be selected on call to
navigator.bluetooth.requestDevice. To use navigator.bluetooth api
webBluetooth should be enabled. If event.preventDefault is not called,
first available device will be selected. callback should be called with
deviceId to be selected, passing empty string to callback will cancel
the request.
Returns:
- `event` Event
- `devices` BluetoothDevice
- `callback` Function
**/
var SelectBluetoothDevice = "select-bluetooth-device";
/**
Emitted when a new frame is generated. Only the dirty area is passed in
the buffer.
Returns:
- `event` Event
- `dirtyRect` Rectangle
- `image` NativeImage
**/
var Paint = "paint";
/**
Emitted when the devtools window instructs the webContents to reload
**/
var DevtoolsReloadPage = "devtools-reload-page";
/**
Emitted when a <webview>'s web contents is being attached to this web
contents. Calling event.preventDefault() will destroy the guest page.
This event can be used to configure webPreferences for the webContents
of a <webview> before it's loaded, and provides the ability to set
settings that can't be set via <webview> attributes. Note: The
specified preload script option will be appear as preloadURL (not
preload) in the webPreferences object emitted with this event.
Returns:
- `event` Event
- `webPreferences` Object
- `params` Object
**/
var WillAttachWebview = "will-attach-webview";
/**
Emitted when a <webview> has been attached to this web contents.
Returns:
- `event` Event
- `webContents` WebContents
**/
var DidAttachWebview = "did-attach-webview";
/**
Emitted when the associated window logs a console message. Will not be
emitted for windows with offscreen rendering enabled.
Returns:
- `level` Integer
- `message` String
- `line` Integer
- `sourceId` String
**/
var ConsoleMessage = "console-message";
}