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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477 | package Torello.Browser;
/**
* A simple way of representing the various Browser Domains offered by the Remote Browser.
* Protocol. Instances of this <B>{@code enum}</B> are attched to each and every
* {@link BrowserEvent} which is generated & propagated by the browser.
*/
public enum Domains
{
// ********************************************************************************************
// ********************************************************************************************
// Browser API Domains
// ********************************************************************************************
// ********************************************************************************************
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Accessibility
*/
Accessibility(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Animation
*/
Animation(true /* BrowserAPI */),
/**
* Audits domain allows investigation of page violations and possible improvements.
* @see Torello.Browser.BrowserAPI.Audits
*/
Audits(true /* BrowserAPI */),
/**
* Defines commands and events for Autofill.
* @see Torello.Browser.BrowserAPI.Autofill
*/
Autofill(true /* BrowserAPI */),
/**
* Defines events for background web platform features.
* @see Torello.Browser.BrowserAPI.BackgroundService
*/
BackgroundService(true /* BrowserAPI */),
/**
* This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.
* @see Torello.Browser.BrowserAPI.BluetoothEmulation
*/
BluetoothEmulation(true /* BrowserAPI */),
/**
* The Browser domain defines methods and events for browser managing.
* @see Torello.Browser.BrowserAPI.Browser
*/
Browser(true /* BrowserAPI */),
/**
* This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and
* styles) have an associated `id` used in subsequent operations on the related object. Each
* object type has a specific `id` structure, and those are not interchangeable between objects
* of different kinds. CSS objects can be loaded using the `get*ForNode()` calls (which accept
* a DOM node id). A client can also keep track of stylesheets via the
* `styleSheetAdded`/`styleSheetRemoved` events and subsequently load the required stylesheet
* contents using the `getStyleSheet[Text]()` methods.
* @see Torello.Browser.BrowserAPI.CSS
*/
CSS(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.CacheStorage
*/
CacheStorage(true /* BrowserAPI */),
/**
* A domain for interacting with Cast, Presentation API, and Remote Playback API
* functionalities.
* @see Torello.Browser.BrowserAPI.Cast
*/
Cast(true /* BrowserAPI */),
/**
* This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror
* object that has an `id`. This `id` can be used to get additional information on the Node,
* resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM
* events only for the nodes that are known to the client. Backend keeps track of the nodes
* that were sent to the client and never sends the same node twice. It is client's
* responsibility to collect information about the nodes that were sent to the client. Note
* that `iframe` owner elements will return corresponding document elements as their child
* nodes.
* @see Torello.Browser.BrowserAPI.DOM
*/
DOM(true /* BrowserAPI */),
/**
* DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript
* execution will stop on these operations as if there was a regular breakpoint set.
* @see Torello.Browser.BrowserAPI.DOMDebugger
*/
DOMDebugger(true /* BrowserAPI */),
/**
* This domain facilitates obtaining document snapshots with DOM, layout, and style
* information.
* @see Torello.Browser.BrowserAPI.DOMSnapshot
*/
DOMSnapshot(true /* BrowserAPI */),
/**
* Query and modify DOM storage.
* @see Torello.Browser.BrowserAPI.DOMStorage
*/
DOMStorage(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.DeviceAccess
*/
DeviceAccess(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.DeviceOrientation
*/
DeviceOrientation(true /* BrowserAPI */),
/**
* This domain emulates different environments for the page.
* @see Torello.Browser.BrowserAPI.Emulation
*/
Emulation(true /* BrowserAPI */),
/**
* EventBreakpoints permits setting JavaScript breakpoints on operations and events occurring
* in native code invoked from JavaScript. Once breakpoint is hit, it is reported through
* Debugger domain, similarly to regular breakpoints being hit.
* @see Torello.Browser.BrowserAPI.EventBreakpoints
*/
EventBreakpoints(true /* BrowserAPI */),
/**
* Defines commands and events for browser extensions.
* @see Torello.Browser.BrowserAPI.Extensions
*/
Extensions(true /* BrowserAPI */),
/**
* This domain allows interacting with the FedCM dialog.
* @see Torello.Browser.BrowserAPI.FedCm
*/
FedCm(true /* BrowserAPI */),
/**
* A domain for letting clients substitute browser's network layer with client code.
* @see Torello.Browser.BrowserAPI.Fetch
*/
Fetch(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.FileSystem
*/
FileSystem(true /* BrowserAPI */),
/**
* This domain provides experimental commands only supported in headless mode.
* @see Torello.Browser.BrowserAPI.HeadlessExperimental
*/
HeadlessExperimental(true /* BrowserAPI */),
/**
* Input/Output operations for streams produced by DevTools.
* @see Torello.Browser.BrowserAPI.IO
*/
IO(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.IndexedDB
*/
IndexedDB(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Input
*/
Input(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Inspector
*/
Inspector(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.LayerTree
*/
LayerTree(true /* BrowserAPI */),
/**
* Provides access to log entries.
* @see Torello.Browser.BrowserAPI.Log
*/
Log(true /* BrowserAPI */),
/**
* This domain allows detailed inspection of media elements
* @see Torello.Browser.BrowserAPI.Media
*/
Media(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Memory
*/
Memory(true /* BrowserAPI */),
/**
* Network domain allows tracking network activities of the page. It exposes information about
* http, file, data and other requests and responses, their headers, bodies, timing, etc.
* @see Torello.Browser.BrowserAPI.Network
*/
Network(true /* BrowserAPI */),
/**
* This domain provides various functionality related to drawing atop the inspected page.
* @see Torello.Browser.BrowserAPI.Overlay
*/
Overlay(true /* BrowserAPI */),
/**
* This domain allows interacting with the browser to control PWAs.
* @see Torello.Browser.BrowserAPI.PWA
*/
PWA(true /* BrowserAPI */),
/**
* Actions and events related to the inspected page belong to the page domain.
* @see Torello.Browser.BrowserAPI.Page
*/
Page(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Performance
*/
Performance(true /* BrowserAPI */),
/**
* Reporting of performance timeline events, as specified in
* https://w3c.github.io/performance-timeline/#dom-performanceobserver.
* @see Torello.Browser.BrowserAPI.PerformanceTimeline
*/
PerformanceTimeline(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Preload
*/
Preload(true /* BrowserAPI */),
/**
* Security
* @see Torello.Browser.BrowserAPI.Security
*/
Security(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.ServiceWorker
*/
ServiceWorker(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Storage
*/
Storage(true /* BrowserAPI */),
/**
* The SystemInfo domain defines methods and events for querying low-level system information.
* @see Torello.Browser.BrowserAPI.SystemInfo
*/
SystemInfo(true /* BrowserAPI */),
/**
* Supports additional targets discovery and allows to attach to them.
* @see Torello.Browser.BrowserAPI.Target
*/
Target(true /* BrowserAPI */),
/**
* The Tethering domain defines methods and events for browser port binding.
* @see Torello.Browser.BrowserAPI.Tethering
*/
Tethering(true /* BrowserAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.BrowserAPI.Tracing
*/
Tracing(true /* BrowserAPI */),
/**
* This domain allows inspection of Web Audio API. https://webaudio.github.io/web-audio-api/
* @see Torello.Browser.BrowserAPI.WebAudio
*/
WebAudio(true /* BrowserAPI */),
/**
* This domain allows configuring virtual authenticators to test the WebAuthn API.
* @see Torello.Browser.BrowserAPI.WebAuthn
*/
WebAuthn(true /* BrowserAPI */),
// ********************************************************************************************
// ********************************************************************************************
// JavaScript API Domains
// ********************************************************************************************
// ********************************************************************************************
/**
* This domain is deprecated - use RunTime or Log instead.
* @see Torello.Browser.JavaScriptAPI.Console
*/
Console(false /* JavaScriptAPI */),
/**
* Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
* breakpoints, stepping through execution, exploring stack traces, etc.
* @see Torello.Browser.JavaScriptAPI.Debugger
*/
Debugger(false /* JavaScriptAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.JavaScriptAPI.HeapProfiler
*/
HeapProfiler(false /* JavaScriptAPI */),
/**
* {@code [No Description provided by Google]}
* @see Torello.Browser.JavaScriptAPI.Profiler
*/
Profiler(false /* JavaScriptAPI */),
/**
* RunTime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
* Evaluation results are returned as mirror object that expose object type, string
* representation and unique identifier that can be used for further object reference. Original
* objects are maintained in memory unless they are either explicitly released or are released
* along with the other objects in their object group.
* @see Torello.Browser.JavaScriptAPI.RunTime
*/
RunTime(false /* JavaScriptAPI */),
/**
* This domain is deprecated.
* @see Torello.Browser.JavaScriptAPI.Schema
*/
Schema(false /* JavaScriptAPI */);
// ********************************************************************************************
// ********************************************************************************************
// Constructor ana Constants
// ********************************************************************************************
// ********************************************************************************************
/** {@code TRUE} indicates that a constant is a member of the JavaScript API */
public static final boolean BrowserAPI = true;
/** {@code FALSE} indicates that a constant is a member of the Browser API */
public static final boolean JSAPI = false;
/**
* When {@code TRUE}, this {@code Domain} is amongst the Browser-API {@code Domains}.
* When {@code FALSE}, this is a member of the JavaScript-API {@code Domains}.
*/
public final boolean browserAPI_Or_JSAPI;
private Domains(boolean browserAPI_Or_JSAPI)
{ this.browserAPI_Or_JSAPI = browserAPI_Or_JSAPI; };
/**
* Geerates a Full-Path Class-Name, as a {@code String} for the Domain that is represented
* this Enum-Constant. If {@code 'this'} Enum-Constant were {@link #Animation}, this method
* would return:
*
* <BR /><BR /><B>{@code "Torello.Browser.BrowserAPI.Animation"}</B>
*/
public String toFullPackageName()
{
return
"Torello.Browser." +
(this.browserAPI_Or_JSAPI ? "BrowserAPI" : "JavaScriptAPI") +
'.' +
this.name();
}
/**
* Generates the Package-Name for the API in which this Domain resides. If {@code 'this'}
* Enum-Constant were {@link #Animation}, this method would return:
*
* <BR /><BR /><B>{@code "Torello.Browser.BrowserAPI"}</B>
*/
public String getPackageName()
{
return
"Torello.Browser." +
(this.browserAPI_Or_JSAPI ? "BrowserAPI" : "JavaScriptAPI");
}
// Used by the builders. It's transient, so it's not serialized
private transient Class<?> domainClass = null;
public Class<?> getDomainClass()
{
if (this.domainClass != null) return this.domainClass;
try
{
this.domainClass = Class.forName(this.toFullPackageName());
if (this.domainClass == null) throw new DomainEnumError(
"Class.forName(...) returned null for Domain Class:\n" +
this.toFullPackageName()
);
return this.domainClass;
}
catch (ClassNotFoundException e)
{
throw new DomainEnumError(
"Unable to load the Domain Class using Class.forName(...):\n" +
this.toFullPackageName(),
e
);
}
catch (LinkageError e)
{
throw new DomainEnumError(
"The Domain Class was found, but Java could not load/link/initialize it:\n" +
this.toFullPackageName(),
e
);
}
catch (SecurityException e)
{
throw new DomainEnumError(
"A SecurityManager prevented loading the Domain Class:\n" +
this.toFullPackageName(),
e
);
}
}
private static class DomainEnumError extends Error
{
protected static final long serialVersionUID = 1;
private DomainEnumError(final String message)
{ super(message); }
private DomainEnumError(final String message, final Throwable cause)
{ super(message, cause); }
}
}
|