cddl 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/README.md +5 -5
- package/bin/cddl.js +3 -1
- package/build/ast.d.ts +14 -14
- package/build/ast.d.ts.map +1 -1
- package/build/ast.js +2 -5
- package/build/cli/commands/repl.d.ts +3 -3
- package/build/cli/commands/repl.d.ts.map +1 -1
- package/build/cli/commands/repl.js +13 -20
- package/build/cli/commands/validate.d.ts +4 -4
- package/build/cli/commands/validate.d.ts.map +1 -1
- package/build/cli/commands/validate.js +14 -19
- package/build/cli/constants.d.ts +1 -1
- package/build/cli/constants.js +1 -4
- package/build/cli/index.d.ts +7 -3
- package/build/cli/index.d.ts.map +1 -1
- package/build/cli/index.js +12 -12
- package/build/constants.d.ts +4 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +8 -6
- package/build/index.d.ts +6 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +16 -17
- package/build/lexer.d.ts +7 -1
- package/build/lexer.d.ts.map +1 -1
- package/build/lexer.js +81 -50
- package/build/parser.d.ts +6 -4
- package/build/parser.d.ts.map +1 -1
- package/build/parser.js +126 -79
- package/build/tokens.d.ts +2 -2
- package/build/tokens.d.ts.map +1 -1
- package/build/tokens.js +2 -5
- package/build/transform/ts.d.ts +3 -0
- package/build/transform/ts.d.ts.map +1 -0
- package/build/transform/ts.js +113 -0
- package/build/types.d.ts +5 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +1 -0
- package/build/utils.d.ts +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +11 -18
- package/examples/webdriver/local.cddl +846 -0
- package/examples/webdriver/remote.cddl +830 -0
- package/package.json +30 -26
- package/vitest.config.ts +16 -0
|
@@ -0,0 +1,830 @@
|
|
|
1
|
+
Command = {
|
|
2
|
+
id: js-uint,
|
|
3
|
+
CommandData,
|
|
4
|
+
Extensible,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
CommandData = (
|
|
8
|
+
BrowserCommand //
|
|
9
|
+
BrowsingContextCommand //
|
|
10
|
+
InputCommand //
|
|
11
|
+
NetworkCommand //
|
|
12
|
+
ScriptCommand //
|
|
13
|
+
SessionCommand
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
EmptyParams = {
|
|
17
|
+
Extensible
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Extensible = (*text => any)
|
|
21
|
+
|
|
22
|
+
js-int = -9007199254740991..9007199254740991
|
|
23
|
+
js-uint = 0..9007199254740991
|
|
24
|
+
|
|
25
|
+
SessionCommand = (
|
|
26
|
+
session.End //
|
|
27
|
+
session.New //
|
|
28
|
+
session.Status //
|
|
29
|
+
session.Subscribe //
|
|
30
|
+
session.Unsubscribe
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
session.CapabilitiesRequest = {
|
|
34
|
+
?alwaysMatch: session.CapabilityRequest,
|
|
35
|
+
?firstMatch: [*session.CapabilityRequest]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
session.CapabilityRequest = {
|
|
39
|
+
?acceptInsecureCerts: bool,
|
|
40
|
+
?browserName: text,
|
|
41
|
+
?browserVersion: text,
|
|
42
|
+
?platformName: text,
|
|
43
|
+
?proxy: {
|
|
44
|
+
?proxyType: "pac" / "direct" / "autodetect" / "system" / "manual",
|
|
45
|
+
?proxyAutoconfigUrl: text,
|
|
46
|
+
?ftpProxy: text,
|
|
47
|
+
?httpProxy: text,
|
|
48
|
+
?noProxy: [*text],
|
|
49
|
+
?sslProxy: text,
|
|
50
|
+
?socksProxy: text,
|
|
51
|
+
?socksVersion: 0..255,
|
|
52
|
+
},
|
|
53
|
+
Extensible
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
session.SubscriptionRequest = {
|
|
57
|
+
events: [*text],
|
|
58
|
+
?contexts: [*browsingContext.BrowsingContext],
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
session.Status = {
|
|
62
|
+
method: "session.status",
|
|
63
|
+
params: EmptyParams,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
session.New = {
|
|
67
|
+
method: "session.new",
|
|
68
|
+
params: session.NewParameters
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
session.NewParameters = {
|
|
72
|
+
capabilities: session.CapabilitiesRequest
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
session.End = {
|
|
76
|
+
method: "session.end",
|
|
77
|
+
params: EmptyParams
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
session.Subscribe = {
|
|
82
|
+
method: "session.subscribe",
|
|
83
|
+
params: session.SubscriptionRequest
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
session.Unsubscribe = {
|
|
87
|
+
method: "session.unsubscribe",
|
|
88
|
+
params: session.SubscriptionRequest
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
BrowserCommand = (
|
|
92
|
+
browser.Close
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
browser.Close = {
|
|
96
|
+
method: "browser.close",
|
|
97
|
+
params: EmptyParams,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
BrowsingContextCommand = (
|
|
101
|
+
browsingContext.CaptureScreenshot //
|
|
102
|
+
browsingContext.Close //
|
|
103
|
+
browsingContext.Create //
|
|
104
|
+
browsingContext.GetTree //
|
|
105
|
+
browsingContext.HandleUserPrompt //
|
|
106
|
+
browsingContext.Navigate //
|
|
107
|
+
browsingContext.Print //
|
|
108
|
+
browsingContext.Reload
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
browsingContext.BrowsingContext = text;
|
|
112
|
+
|
|
113
|
+
browsingContext.Navigation = text;
|
|
114
|
+
|
|
115
|
+
browsingContext.ReadinessState = "none" / "interactive" / "complete"
|
|
116
|
+
|
|
117
|
+
browsingContext.CaptureScreenshot = {
|
|
118
|
+
method: "browsingContext.captureScreenshot",
|
|
119
|
+
params: browsingContext.CaptureScreenshotParameters
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
browsingContext.CaptureScreenshotParameters = {
|
|
123
|
+
context: browsingContext.BrowsingContext
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
browsingContext.Close = {
|
|
127
|
+
method: "browsingContext.close",
|
|
128
|
+
params: browsingContext.CloseParameters
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
browsingContext.CloseParameters = {
|
|
132
|
+
context: browsingContext.BrowsingContext
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
browsingContext.Create = {
|
|
136
|
+
method: "browsingContext.create",
|
|
137
|
+
params: browsingContext.CreateParameters
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
browsingContext.CreateType = "tab" / "window"
|
|
141
|
+
|
|
142
|
+
browsingContext.CreateParameters = {
|
|
143
|
+
type: browsingContext.CreateType,
|
|
144
|
+
?referenceContext: browsingContext.BrowsingContext
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
browsingContext.GetTree = {
|
|
148
|
+
method: "browsingContext.getTree",
|
|
149
|
+
params: browsingContext.GetTreeParameters
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
browsingContext.GetTreeParameters = {
|
|
153
|
+
?maxDepth: js-uint,
|
|
154
|
+
?root: browsingContext.BrowsingContext,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
browsingContext.HandleUserPrompt = {
|
|
158
|
+
method: "browsingContext.handleUserPrompt",
|
|
159
|
+
params: browsingContext.HandleUserPromptParameters
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
browsingContext.HandleUserPromptParameters = {
|
|
163
|
+
context: browsingContext.BrowsingContext,
|
|
164
|
+
? accept: bool,
|
|
165
|
+
? userText: text,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
browsingContext.Navigate = {
|
|
169
|
+
method: "browsingContext.navigate",
|
|
170
|
+
params: browsingContext.NavigateParameters
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
browsingContext.NavigateParameters = {
|
|
174
|
+
context: browsingContext.BrowsingContext,
|
|
175
|
+
url: text,
|
|
176
|
+
?wait: browsingContext.ReadinessState,
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
browsingContext.Print = {
|
|
180
|
+
method: "browsingContext.print",
|
|
181
|
+
params: browsingContext.PrintParameters
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
browsingContext.PrintParameters = {
|
|
185
|
+
context: browsingContext.BrowsingContext,
|
|
186
|
+
?background: bool .default false,
|
|
187
|
+
?margin: browsingContext.PrintMarginParameters,
|
|
188
|
+
?orientation: ("portrait" / "landscape") .default "portrait",
|
|
189
|
+
?page: browsingContext.PrintPageParameters,
|
|
190
|
+
?pageRanges: [*(js-uint / text)],
|
|
191
|
+
?scale: 0.1..2.0 .default 1.0,
|
|
192
|
+
?shrinkToFit: bool .default true,
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
browsingContext.PrintMarginParameters = {
|
|
196
|
+
?bottom: (float .ge 0.0) .default 1.0,
|
|
197
|
+
?left: (float .ge 0.0) .default 1.0,
|
|
198
|
+
?right: (float .ge 0.0) .default 1.0,
|
|
199
|
+
?top: (float .ge 0.0) .default 1.0,
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
browsingContext.PrintPageParameters = {
|
|
203
|
+
?height: (float .ge 0.0) .default 27.94,
|
|
204
|
+
?width: (float .ge 0.0) .default 21.59,
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
browsingContext.Reload = {
|
|
208
|
+
method: "browsingContext.reload",
|
|
209
|
+
params: browsingContext.ReloadParameters
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
browsingContext.ReloadParameters = {
|
|
213
|
+
context: browsingContext.BrowsingContext,
|
|
214
|
+
?ignoreCache: bool,
|
|
215
|
+
?wait: browsingContext.ReadinessState,
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
NetworkCommand = (
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
network.Request = text;
|
|
224
|
+
|
|
225
|
+
ScriptCommand = (
|
|
226
|
+
script.AddPreloadScriptCommand //
|
|
227
|
+
script.CallFunction //
|
|
228
|
+
script.Disown //
|
|
229
|
+
script.Evaluate //
|
|
230
|
+
script.GetRealms
|
|
231
|
+
script.RemovePreloadScriptCommand
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
script.Channel = text;
|
|
235
|
+
|
|
236
|
+
script.ChannelValue = {
|
|
237
|
+
type: "channel",
|
|
238
|
+
value: script.ChannelProperties,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
script.ChannelProperties = {
|
|
242
|
+
channel: script.Channel,
|
|
243
|
+
?serializationOptions: script.SerializationOptions,
|
|
244
|
+
?ownership: script.ResultOwnership,
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
script.EvaluateResult = (
|
|
248
|
+
script.EvaluateResultSuccess //
|
|
249
|
+
script.EvaluateResultException
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
script.EvaluateResultSuccess = {
|
|
253
|
+
type: "success",
|
|
254
|
+
result: script.RemoteValue,
|
|
255
|
+
realm: script.Realm
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
script.EvaluateResultException = {
|
|
259
|
+
type: "exception",
|
|
260
|
+
exceptionDetails: script.ExceptionDetails
|
|
261
|
+
realm: script.Realm
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
script.ExceptionDetails = {
|
|
265
|
+
columnNumber: js-uint,
|
|
266
|
+
exception: script.RemoteValue,
|
|
267
|
+
lineNumber: js-uint,
|
|
268
|
+
stackTrace: script.StackTrace,
|
|
269
|
+
text: text,
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
script.Handle = text;
|
|
273
|
+
|
|
274
|
+
script.LocalValue = (
|
|
275
|
+
script.PrimitiveProtocolValue //
|
|
276
|
+
script.ArrayLocalValue //
|
|
277
|
+
script.DateLocalValue //
|
|
278
|
+
script.MapLocalValue //
|
|
279
|
+
script.ObjectLocalValue //
|
|
280
|
+
script.RegExpLocalValue //
|
|
281
|
+
script.SetLocalValue
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
script.ListLocalValue = [*script.LocalValue];
|
|
285
|
+
|
|
286
|
+
script.ArrayLocalValue = {
|
|
287
|
+
type: "array",
|
|
288
|
+
value: script.ListLocalValue,
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
script.DateLocalValue = {
|
|
292
|
+
type: "date",
|
|
293
|
+
value: text
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
script.MappingLocalValue = [*[(script.LocalValue / text), script.LocalValue]];
|
|
297
|
+
|
|
298
|
+
script.MapLocalValue = {
|
|
299
|
+
type: "map",
|
|
300
|
+
value: script.MappingLocalValue,
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
script.ObjectLocalValue = {
|
|
304
|
+
type: "object",
|
|
305
|
+
value: script.MappingLocalValue,
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
script.RegExpValue = {
|
|
309
|
+
pattern: text,
|
|
310
|
+
?flags: text,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
script.RegExpLocalValue = {
|
|
314
|
+
type: "regexp",
|
|
315
|
+
value: script.RegExpValue,
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
script.SetLocalValue = {
|
|
319
|
+
type: "set",
|
|
320
|
+
value: script.ListLocalValue,
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
script.PreloadScript = text;
|
|
324
|
+
|
|
325
|
+
script.Realm = text;
|
|
326
|
+
|
|
327
|
+
script.PrimitiveProtocolValue = (
|
|
328
|
+
script.UndefinedValue //
|
|
329
|
+
script.NullValue //
|
|
330
|
+
script.StringValue //
|
|
331
|
+
script.NumberValue //
|
|
332
|
+
script.BooleanValue //
|
|
333
|
+
script.BigIntValue
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
script.UndefinedValue = {
|
|
337
|
+
type: "undefined",
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
script.NullValue = {
|
|
341
|
+
type: "null",
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
script.StringValue = {
|
|
345
|
+
type: "string",
|
|
346
|
+
value: text,
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity";
|
|
350
|
+
|
|
351
|
+
script.NumberValue = {
|
|
352
|
+
type: "number",
|
|
353
|
+
value: number / script.SpecialNumber,
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
script.BooleanValue = {
|
|
357
|
+
type: "boolean",
|
|
358
|
+
value: bool,
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
script.BigIntValue = {
|
|
362
|
+
type: "bigint",
|
|
363
|
+
value: text,
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
script.RealmType = "window" / "dedicated-worker" / "shared-worker" / "service-worker" /
|
|
367
|
+
"worker" / "paint-worklet" / "audio-worklet" / "worklet"
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
script.RemoteReference = (
|
|
372
|
+
script.SharedReference //
|
|
373
|
+
script.RemoteObjectReference
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
script.SharedReference = {
|
|
377
|
+
sharedId: script.SharedId
|
|
378
|
+
|
|
379
|
+
?handle: script.Handle,
|
|
380
|
+
Extensible
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
script.RemoteObjectReference = {
|
|
384
|
+
handle: script.Handle,
|
|
385
|
+
|
|
386
|
+
?sharedId: script.SharedId
|
|
387
|
+
Extensible
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
script.RemoteValue = (
|
|
391
|
+
script.PrimitiveProtocolValue //
|
|
392
|
+
script.SymbolRemoteValue //
|
|
393
|
+
script.ArrayRemoteValue //
|
|
394
|
+
script.ObjectRemoteValue //
|
|
395
|
+
script.FunctionRemoteValue //
|
|
396
|
+
script.RegExpRemoteValue //
|
|
397
|
+
script.DateRemoteValue //
|
|
398
|
+
script.MapRemoteValue //
|
|
399
|
+
script.SetRemoteValue //
|
|
400
|
+
script.WeakMapRemoteValue //
|
|
401
|
+
script.WeakSetRemoteValue //
|
|
402
|
+
script.IteratorRemoteValue //
|
|
403
|
+
script.GeneratorRemoteValue //
|
|
404
|
+
script.ErrorRemoteValue //
|
|
405
|
+
script.ProxyRemoteValue //
|
|
406
|
+
script.PromiseRemoteValue //
|
|
407
|
+
script.TypedArrayRemoteValue //
|
|
408
|
+
script.ArrayBufferRemoteValue //
|
|
409
|
+
script.NodeListRemoteValue //
|
|
410
|
+
script.HTMLCollectionRemoteValue //
|
|
411
|
+
script.NodeRemoteValue //
|
|
412
|
+
script.WindowProxyRemoteValue
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
script.InternalId = js-uint;
|
|
416
|
+
|
|
417
|
+
script.ListRemoteValue = [*script.RemoteValue];
|
|
418
|
+
|
|
419
|
+
script.MappingRemoteValue = [*[(script.RemoteValue / text), script.RemoteValue]];
|
|
420
|
+
|
|
421
|
+
script.SymbolRemoteValue = {
|
|
422
|
+
type: "symbol",
|
|
423
|
+
?handle: script.Handle,
|
|
424
|
+
?internalId: script.InternalId,
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
script.ArrayRemoteValue = {
|
|
428
|
+
type: "array",
|
|
429
|
+
?handle: script.Handle,
|
|
430
|
+
?internalId: script.InternalId,
|
|
431
|
+
?value: script.ListRemoteValue,
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
script.ObjectRemoteValue = {
|
|
435
|
+
type: "object",
|
|
436
|
+
?handle: script.Handle,
|
|
437
|
+
?internalId: script.InternalId,
|
|
438
|
+
?value: script.MappingRemoteValue,
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
script.FunctionRemoteValue = {
|
|
442
|
+
type: "function",
|
|
443
|
+
?handle: script.Handle,
|
|
444
|
+
?internalId: script.InternalId,
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
script.RegExpRemoteValue = {
|
|
448
|
+
script.RegExpLocalValue,
|
|
449
|
+
?handle: script.Handle,
|
|
450
|
+
?internalId: script.InternalId,
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
script.DateRemoteValue = {
|
|
454
|
+
script.DateLocalValue,
|
|
455
|
+
?handle: script.Handle,
|
|
456
|
+
?internalId: script.InternalId,
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
script.MapRemoteValue = {
|
|
460
|
+
type: "map",
|
|
461
|
+
?handle: script.Handle,
|
|
462
|
+
?internalId: script.InternalId,
|
|
463
|
+
?value: script.MappingRemoteValue,
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
script.SetRemoteValue = {
|
|
467
|
+
type: "set",
|
|
468
|
+
?handle: script.Handle,
|
|
469
|
+
?internalId: script.InternalId,
|
|
470
|
+
?value: script.ListRemoteValue
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
script.WeakMapRemoteValue = {
|
|
474
|
+
type: "weakmap",
|
|
475
|
+
?handle: script.Handle,
|
|
476
|
+
?internalId: script.InternalId,
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
script.WeakSetRemoteValue = {
|
|
480
|
+
type: "weakset",
|
|
481
|
+
?handle: script.Handle,
|
|
482
|
+
?internalId: script.InternalId,
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
script.IteratorRemoteValue = {
|
|
486
|
+
type: "iterator",
|
|
487
|
+
?handle: script.Handle,
|
|
488
|
+
?internalId: script.InternalId,
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
script.GeneratorRemoteValue = {
|
|
492
|
+
type: "generator",
|
|
493
|
+
?handle: script.Handle,
|
|
494
|
+
?internalId: script.InternalId,
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
script.ErrorRemoteValue = {
|
|
498
|
+
type: "error",
|
|
499
|
+
?handle: script.Handle,
|
|
500
|
+
?internalId: script.InternalId,
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
script.ProxyRemoteValue = {
|
|
504
|
+
type: "proxy",
|
|
505
|
+
?handle: script.Handle,
|
|
506
|
+
?internalId: script.InternalId,
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
script.PromiseRemoteValue = {
|
|
510
|
+
type: "promise",
|
|
511
|
+
?handle: script.Handle,
|
|
512
|
+
?internalId: script.InternalId,
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
script.TypedArrayRemoteValue = {
|
|
516
|
+
type: "typedarray",
|
|
517
|
+
?handle: script.Handle,
|
|
518
|
+
?internalId: script.InternalId,
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
script.ArrayBufferRemoteValue = {
|
|
522
|
+
type: "arraybuffer",
|
|
523
|
+
?handle: script.Handle,
|
|
524
|
+
?internalId: script.InternalId,
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
script.NodeListRemoteValue = {
|
|
528
|
+
type: "nodelist",
|
|
529
|
+
?handle: script.Handle,
|
|
530
|
+
?internalId: script.InternalId,
|
|
531
|
+
?value: script.ListRemoteValue,
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
script.HTMLCollectionRemoteValue = {
|
|
535
|
+
type: "htmlcollection",
|
|
536
|
+
?handle: script.Handle,
|
|
537
|
+
?internalId: script.InternalId,
|
|
538
|
+
?value: script.ListRemoteValue,
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
script.NodeRemoteValue = {
|
|
542
|
+
type: "node",
|
|
543
|
+
?sharedId: script.SharedId,
|
|
544
|
+
?handle: script.Handle,
|
|
545
|
+
?internalId: script.InternalId,
|
|
546
|
+
?value: script.NodeProperties,
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
script.NodeProperties = {
|
|
550
|
+
nodeType: js-uint,
|
|
551
|
+
childNodeCount: js-uint,
|
|
552
|
+
?attributes: {*text => text},
|
|
553
|
+
?children: [*script.NodeRemoteValue],
|
|
554
|
+
?localName: text,
|
|
555
|
+
?mode: "open" / "closed",
|
|
556
|
+
?namespaceURI: text,
|
|
557
|
+
?nodeValue: text,
|
|
558
|
+
?shadowRoot: script.NodeRemoteValue / null,
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
script.WindowProxyRemoteValue = {
|
|
562
|
+
type: "window",
|
|
563
|
+
?handle: script.Handle,
|
|
564
|
+
?internalId: script.InternalId,
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
script.ResultOwnership = "root" / "none"
|
|
568
|
+
|
|
569
|
+
script.SerializationOptions = {
|
|
570
|
+
?maxDomDepth: (js-uint / null) .default 0,
|
|
571
|
+
?maxObjectDepth: (js-uint / null) .default null,
|
|
572
|
+
?includeShadowTree: ("none" / "open" / "all") .default "none",
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
script.SharedId = text;
|
|
576
|
+
|
|
577
|
+
script.StackFrame = {
|
|
578
|
+
columnNumber: js-uint,
|
|
579
|
+
functionName: text,
|
|
580
|
+
lineNumber: js-uint,
|
|
581
|
+
url: text,
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
script.StackTrace = {
|
|
585
|
+
callFrames: [*script.StackFrame],
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
script.RealmTarget = {
|
|
589
|
+
realm: script.Realm
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
script.ContextTarget = {
|
|
593
|
+
context: browsingContext.BrowsingContext,
|
|
594
|
+
?sandbox: text
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
script.Target = (
|
|
598
|
+
script.RealmTarget //
|
|
599
|
+
script.ContextTarget
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
script.AddPreloadScriptCommand = {
|
|
603
|
+
method: "script.addPreloadScript",
|
|
604
|
+
params: script.AddPreloadScriptParameters
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
script.AddPreloadScriptParameters = {
|
|
608
|
+
functionDeclaration: text,
|
|
609
|
+
?arguments: [*script.ChannelValue],
|
|
610
|
+
?sandbox: text
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
script.Disown = {
|
|
614
|
+
method: "script.disown",
|
|
615
|
+
params: script.DisownParameters
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
script.DisownParameters = {
|
|
619
|
+
handles: [script.Handle]
|
|
620
|
+
target: script.Target;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
script.CallFunction = {
|
|
624
|
+
method: "script.callFunction",
|
|
625
|
+
params: script.CallFunctionParameters
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
script.CallFunctionParameters = {
|
|
629
|
+
functionDeclaration: text,
|
|
630
|
+
awaitPromise: bool,
|
|
631
|
+
target: script.Target,
|
|
632
|
+
?arguments: [*script.ArgumentValue],
|
|
633
|
+
?resultOwnership: script.ResultOwnership,
|
|
634
|
+
?serializationOptions: script.SerializationOptions,
|
|
635
|
+
?this: script.ArgumentValue,
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
script.ArgumentValue = (
|
|
639
|
+
script.RemoteReference //
|
|
640
|
+
script.LocalValue //
|
|
641
|
+
script.ChannelValue
|
|
642
|
+
);
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
script.Evaluate = {
|
|
646
|
+
method: "script.evaluate",
|
|
647
|
+
params: script.EvaluateParameters
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
script.EvaluateParameters = {
|
|
651
|
+
expression: text,
|
|
652
|
+
target: script.Target,
|
|
653
|
+
awaitPromise: bool,
|
|
654
|
+
?resultOwnership: script.ResultOwnership,
|
|
655
|
+
?serializationOptions: script.SerializationOptions,
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
script.GetRealms = {
|
|
659
|
+
method: "script.getRealms",
|
|
660
|
+
params: script.GetRealmsParameters
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
script.GetRealmsParameters = {
|
|
664
|
+
?context: browsingContext.BrowsingContext,
|
|
665
|
+
?type: script.RealmType,
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
script.RemovePreloadScriptCommand = {
|
|
669
|
+
method: "script.removePreloadScript",
|
|
670
|
+
params: script.RemovePreloadScriptParameters
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
script.RemovePreloadScriptParameters = {
|
|
674
|
+
script: script.PreloadScript
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
InputCommand = (
|
|
679
|
+
input.PerformActions //
|
|
680
|
+
input.ReleaseActions
|
|
681
|
+
)
|
|
682
|
+
|
|
683
|
+
input.ElementOrigin = {
|
|
684
|
+
type: "element",
|
|
685
|
+
element: script.SharedReference
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
input.PerformActions = {
|
|
689
|
+
method: "input.performActions",
|
|
690
|
+
params: input.PerformActionsParameters
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
input.PerformActionsParameters = {
|
|
694
|
+
context: browsingContext.BrowsingContext,
|
|
695
|
+
actions: [*input.SourceActions]
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
input.SourceActions = (
|
|
699
|
+
input.NoneSourceActions //
|
|
700
|
+
input.KeySourceActions //
|
|
701
|
+
input.PointerSourceActions //
|
|
702
|
+
input.WheelSourceActions
|
|
703
|
+
)
|
|
704
|
+
|
|
705
|
+
input.NoneSourceActions = {
|
|
706
|
+
type: "none",
|
|
707
|
+
id: text,
|
|
708
|
+
actions: [*input.NoneSourceAction]
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
input.NoneSourceAction = input.PauseAction
|
|
712
|
+
|
|
713
|
+
input.KeySourceActions = {
|
|
714
|
+
type: "key",
|
|
715
|
+
id: text,
|
|
716
|
+
actions: [*input.KeySourceAction]
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
input.KeySourceAction = (
|
|
720
|
+
input.PauseAction //
|
|
721
|
+
input.KeyDownAction //
|
|
722
|
+
input.KeyUpAction
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
input.PointerSourceActions = {
|
|
726
|
+
type: "pointer",
|
|
727
|
+
id: text,
|
|
728
|
+
? parameters: input.PointerParameters,
|
|
729
|
+
actions: [*input.PointerSourceAction]
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
input.PointerType = "mouse" / "pen" / "touch"
|
|
733
|
+
|
|
734
|
+
input.PointerParameters = {
|
|
735
|
+
?pointerType: input.PointerType .default "mouse"
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
input.PointerSourceAction = (
|
|
739
|
+
input.PauseAction //
|
|
740
|
+
input.PointerDownAction //
|
|
741
|
+
input.PointerUpAction //
|
|
742
|
+
input.PointerMoveAction
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
input.WheelSourceActions = {
|
|
746
|
+
type: "wheel",
|
|
747
|
+
id: text,
|
|
748
|
+
actions: [*input.WheelSourceAction]
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
input.WheelSourceAction = (
|
|
752
|
+
input.PauseAction //
|
|
753
|
+
input.WheelScrollAction
|
|
754
|
+
)
|
|
755
|
+
|
|
756
|
+
input.PauseAction = {
|
|
757
|
+
type: "pause",
|
|
758
|
+
? duration: js-uint
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
input.KeyDownAction = {
|
|
762
|
+
type: "keyDown",
|
|
763
|
+
value: text
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
input.KeyUpAction = {
|
|
767
|
+
type: "keyUp",
|
|
768
|
+
value: text
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
input.PointerUpAction = {
|
|
772
|
+
type: "pointerUp",
|
|
773
|
+
button: js-uint,
|
|
774
|
+
input.PointerCommonProperties
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
input.PointerDownAction = {
|
|
778
|
+
type: "pointerDown",
|
|
779
|
+
button: js-uint,
|
|
780
|
+
input.PointerCommonProperties
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
input.PointerMoveAction = {
|
|
784
|
+
type: "pointerMove",
|
|
785
|
+
x: js-int,
|
|
786
|
+
y: js-int,
|
|
787
|
+
? duration: js-uint,
|
|
788
|
+
? origin: input.Origin,
|
|
789
|
+
input.PointerCommonProperties
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
input.WheelScrollAction = {
|
|
793
|
+
type: "scroll",
|
|
794
|
+
x: js-int,
|
|
795
|
+
y: js-int,
|
|
796
|
+
deltaX: js-int,
|
|
797
|
+
deltaY: js-int,
|
|
798
|
+
? duration: js-uint,
|
|
799
|
+
? origin: input.Origin .default "viewport",
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
input.PointerCommonProperties = (
|
|
803
|
+
? width: js-uint .default 1,
|
|
804
|
+
? height: js-uint .default 1,
|
|
805
|
+
? pressure: float .default 0.0,
|
|
806
|
+
? tangentialPressure: float .default 0.0,
|
|
807
|
+
? twist: 0..359 .default 0,
|
|
808
|
+
(input.TiltProperties // input.AngleProperties)
|
|
809
|
+
)
|
|
810
|
+
|
|
811
|
+
input.AngleProperties = (
|
|
812
|
+
? altitudeAngle: float .default 0.0,
|
|
813
|
+
? azimuthAngle: float .default 0.0,
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
input.TiltProperties = (
|
|
817
|
+
? tiltX: -90..90 .default 0,
|
|
818
|
+
? tiltY: -90..90 .default 0,
|
|
819
|
+
)
|
|
820
|
+
|
|
821
|
+
input.Origin = "viewport" / "pointer" / input.ElementOrigin
|
|
822
|
+
|
|
823
|
+
input.ReleaseActions = {
|
|
824
|
+
method: "input.releaseActions",
|
|
825
|
+
params: input.ReleaseActionsParameters
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
input.ReleaseActionsParameters = {
|
|
829
|
+
context: browsingContext.BrowsingContext,
|
|
830
|
+
}
|