webdriver-bidi-protocol 0.0.8 → 0.1.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.
@@ -29,9 +29,6 @@ updates:
29
29
  - '*'
30
30
  - package-ecosystem: gitsubmodule
31
31
  directory: /
32
- commit-message:
33
- # Prefix with 'fix' to generate patch releases.
34
- prefix: fix
35
32
  schedule:
36
33
  interval: daily
37
34
  open-pull-requests-limit: 1
@@ -21,26 +21,12 @@ jobs:
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
23
  - name: Check out repository
24
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25
25
  with:
26
26
  fetch-depth: 2
27
- ref: ${{ github.head_ref }}
28
- token: ${{ secrets.BROWSER_AUTOMATION_BOT_TOKEN }}
29
27
  - name: Install cddlconv
30
- uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # v3.1.1
31
- with:
32
- crate: cddlconv
33
- version: 0.1.5
28
+ run: cargo install cddlconv@0.1.5
34
29
  - name: Install dependencies
35
30
  run: npm ci
36
31
  - name: Build and test
37
32
  run: npm test
38
- - name: Commit and push changes
39
- if: contains(github.event.pull_request.labels.*.name, 'commit-updates')
40
- uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # 5.0.1
41
- with:
42
- commit_message: "fix: generate files"
43
- commit_options: -n --signoff
44
- commit_user_name: Browser Automation Bot
45
- commit_user_email: browser-automation-bot@google.com
46
- commit_author: Browser Automation Bot <browser-automation-bot@google.com>
@@ -16,7 +16,7 @@ jobs:
16
16
  contents: read
17
17
  steps:
18
18
  - name: Check out repository
19
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
19
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20
20
  with:
21
21
  fetch-depth: 2
22
22
  - name: Set npm registry
@@ -3,10 +3,7 @@ on:
3
3
  branches:
4
4
  - main
5
5
 
6
- permissions:
7
- contents: write
8
- pull-requests: write
9
-
6
+ permissions: read-all
10
7
  name: release-please
11
8
 
12
9
  jobs:
@@ -18,4 +15,5 @@ jobs:
18
15
  token: ${{ secrets.BROWSER_AUTOMATION_BOT_TOKEN }}
19
16
  target-branch: main
20
17
  config-file: release-please-config.json
21
- manifest-file: .release-please-manifest.json
18
+ manifest-file: .release-please-manifest.json
19
+ fork: true
package/.gitmodules CHANGED
@@ -4,3 +4,6 @@
4
4
  [submodule "specs/permissions"]
5
5
  path = specs/permissions
6
6
  url = https://github.com/w3c/permissions.git
7
+ [submodule "specs/web-bluetooth"]
8
+ path = specs/web-bluetooth
9
+ url = https://github.com/WebBluetoothCG/web-bluetooth.git
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.0.8"
2
+ ".": "0.1.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.0](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.0.9...webdriver-bidi-protocol-v0.1.0) (2024-12-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * add bluetooth ([#66](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/66)) ([e42e8d9](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/e42e8d9896540020955d81b08066bdf92ed16602))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add repository ([#19](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/19)) ([91def9d](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/91def9dd0baeab3476e7154676e40d5a709da2c3))
14
+ * another repository fix ([72c215c](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/72c215cbcf76c97317deff925d1ff73732ed5bab))
15
+ * bump specs/webdriver-bidi from `0575bf7` to `9eaa877` ([#65](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/65)) ([d0ed8ef](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d0ed8ef0254fb7786b5e2cd7b716aa772cc49fcd))
16
+ * bump specs/webdriver-bidi from `05a283e` to `62b8dfe` ([#16](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/16)) ([51dac71](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/51dac71ca4ea2e4e85eee7ba82a6a8ac7ff584a4))
17
+ * bump specs/webdriver-bidi from `0c366b0` to `a46d71b` ([#30](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/30)) ([c926381](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/c92638156ca8cbe36e2485fde2c3eca4b6d14cd7))
18
+ * bump specs/webdriver-bidi from `0fa2d99` to `712c17f` ([#36](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/36)) ([5e35acb](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/5e35acb0af5663fdace139da9648a298adf4b863))
19
+ * bump specs/webdriver-bidi from `287e9c6` to `0575bf7` ([#59](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/59)) ([20ec66a](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/20ec66ae46acdb49211991f603826bfbab0c0762))
20
+ * bump specs/webdriver-bidi from `62b8dfe` to `0c366b0` ([#25](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/25)) ([e6da243](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/e6da2439e38f2c403319ce1dbed16c9b8029667d))
21
+ * bump specs/webdriver-bidi from `712c17f` to `287e9c6` ([#43](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/43)) ([2f378f5](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/2f378f5890cbfec58e62f466b73fda0523083216))
22
+ * bump specs/webdriver-bidi from `a46d71b` to `0fa2d99` ([#33](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/33)) ([596a0ab](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/596a0ab776e061bccbc67a4fc38db4d5cce84643))
23
+ * document usage ([#7](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/7)) ([d98a6ee](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d98a6ee23cbaa943440e2b40831a0c56aa0d6c18))
24
+ * update repository ([28cf911](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/28cf911e59ad5b177df47d04fc012d8c9cfe7fde))
25
+
26
+ ## [0.0.9](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.0.8...webdriver-bidi-protocol-v0.0.9) (2024-09-03)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * bump specs/webdriver-bidi from `0fa2d99` to `712c17f` ([#36](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/36)) ([5e35acb](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/5e35acb0af5663fdace139da9648a298adf4b863))
32
+ * bump specs/webdriver-bidi from `712c17f` to `287e9c6` ([#43](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/43)) ([2f378f5](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/2f378f5890cbfec58e62f466b73fda0523083216))
33
+
3
34
  ## [0.0.8](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.0.7...webdriver-bidi-protocol-v0.0.8) (2024-07-10)
4
35
 
5
36
 
package/out/gen/main.d.ts CHANGED
@@ -56,6 +56,7 @@ export declare const enum ErrorCode {
56
56
  InvalidArgument = 'invalid argument',
57
57
  InvalidSelector = 'invalid selector',
58
58
  InvalidSessionId = 'invalid session id',
59
+ InvalidWebExtension = 'invalid web extension',
59
60
  MoveTargetOutOfBounds = 'move target out of bounds',
60
61
  NoSuchAlert = 'no such alert',
61
62
  NoSuchElement = 'no such element',
@@ -68,6 +69,7 @@ export declare const enum ErrorCode {
68
69
  NoSuchScript = 'no such script',
69
70
  NoSuchStoragePartition = 'no such storage partition',
70
71
  NoSuchUserContext = 'no such user context',
72
+ NoSuchWebExtension = 'no such web extension',
71
73
  SessionNotCreated = 'session not created',
72
74
  UnableToCaptureScreen = 'unable to capture screen',
73
75
  UnableToCloseBrowser = 'unable to close browser',
@@ -235,11 +237,28 @@ export declare namespace Session {
235
237
  export type BrowserCommand =
236
238
  | Browser.Close
237
239
  | Browser.CreateUserContext
240
+ | Browser.GetClientWindows
238
241
  | Browser.GetUserContexts
239
- | Browser.RemoveUserContext;
242
+ | Browser.RemoveUserContext
243
+ | Browser.SetClientWindowState
244
+ | Record<string, never>;
240
245
  export type BrowserResult =
241
246
  | Browser.CreateUserContextResult
242
247
  | Browser.GetUserContextsResult;
248
+ export declare namespace Browser {
249
+ type ClientWindow = string;
250
+ }
251
+ export declare namespace Browser {
252
+ type ClientWindowInfo = {
253
+ active: boolean;
254
+ clientWindow: Browser.ClientWindow;
255
+ height: JsUint;
256
+ state: 'fullscreen' | 'maximized' | 'minimized' | 'normal';
257
+ width: JsUint;
258
+ x: JsInt;
259
+ y: JsInt;
260
+ };
261
+ }
243
262
  export declare namespace Browser {
244
263
  type UserContext = string;
245
264
  }
@@ -263,6 +282,17 @@ export declare namespace Browser {
263
282
  export declare namespace Browser {
264
283
  type CreateUserContextResult = Browser.UserContextInfo;
265
284
  }
285
+ export declare namespace Browser {
286
+ type GetClientWindows = {
287
+ method: 'browser.getClientWindows';
288
+ params: EmptyParams;
289
+ };
290
+ }
291
+ export declare namespace Browser {
292
+ type GetClientWindowsResult = {
293
+ clientWindows: [...Browser.ClientWindowInfo[]];
294
+ };
295
+ }
266
296
  export declare namespace Browser {
267
297
  type GetUserContexts = {
268
298
  method: 'browser.getUserContexts';
@@ -285,6 +315,33 @@ export declare namespace Browser {
285
315
  userContext: Browser.UserContext;
286
316
  };
287
317
  }
318
+ export declare namespace Browser {
319
+ type SetClientWindowState = {
320
+ method: 'browser.setClientWindowState';
321
+ params: Browser.SetClientWindowStateParameters;
322
+ };
323
+ }
324
+ export declare namespace Browser {
325
+ type SetClientWindowStateParameters =
326
+ | ({
327
+ clientWindow: Browser.ClientWindow;
328
+ } & Browser.ClientWindowNamedState)
329
+ | Browser.ClientWindowRectState;
330
+ }
331
+ export declare namespace Browser {
332
+ type ClientWindowNamedState = {
333
+ state: 'fullscreen' | 'maximized' | 'minimized';
334
+ };
335
+ }
336
+ export declare namespace Browser {
337
+ type ClientWindowRectState = {
338
+ state: 'normal';
339
+ width?: JsUint;
340
+ height?: JsUint;
341
+ x?: JsInt;
342
+ y?: JsInt;
343
+ };
344
+ }
288
345
  export type BrowsingContextCommand =
289
346
  | BrowsingContext.Activate
290
347
  | BrowsingContext.CaptureScreenshot
@@ -304,6 +361,7 @@ export type BrowsingContextEvent =
304
361
  | BrowsingContext.DomContentLoaded
305
362
  | BrowsingContext.DownloadWillBegin
306
363
  | BrowsingContext.FragmentNavigated
364
+ | BrowsingContext.HistoryUpdated
307
365
  | BrowsingContext.Load
308
366
  | BrowsingContext.NavigationAborted
309
367
  | BrowsingContext.NavigationFailed
@@ -327,6 +385,7 @@ export declare namespace BrowsingContext {
327
385
  export declare namespace BrowsingContext {
328
386
  type Info = {
329
387
  children: BrowsingContext.InfoList | null;
388
+ clientWindow: Browser.ClientWindow;
330
389
  context: BrowsingContext.BrowsingContext;
331
390
  originalOpener: BrowsingContext.BrowsingContext | null;
332
391
  url: string;
@@ -729,6 +788,18 @@ export declare namespace BrowsingContext {
729
788
  params: BrowsingContext.NavigationInfo;
730
789
  };
731
790
  }
791
+ export declare namespace BrowsingContext {
792
+ type HistoryUpdated = {
793
+ method: 'browsingContext.historyUpdated';
794
+ params: BrowsingContext.HistoryUpdatedParameters;
795
+ };
796
+ }
797
+ export declare namespace BrowsingContext {
798
+ type HistoryUpdatedParameters = {
799
+ context: BrowsingContext.BrowsingContext;
800
+ url: string;
801
+ };
802
+ }
732
803
  export declare namespace BrowsingContext {
733
804
  type DomContentLoaded = {
734
805
  method: 'browsingContext.domContentLoaded';
@@ -894,11 +965,11 @@ export declare namespace Network {
894
965
  }
895
966
  export declare namespace Network {
896
967
  type Initiator = {
897
- type: 'parser' | 'script' | 'preflight' | 'other';
898
968
  columnNumber?: JsUint;
899
969
  lineNumber?: JsUint;
900
- stackTrace?: Script.StackTrace;
901
970
  request?: Network.Request;
971
+ stackTrace?: Script.StackTrace;
972
+ type?: 'parser' | 'script' | 'preflight' | 'other';
902
973
  };
903
974
  }
904
975
  export declare namespace Network {
@@ -916,6 +987,8 @@ export declare namespace Network {
916
987
  cookies: [...Network.Cookie[]];
917
988
  headersSize: JsUint;
918
989
  bodySize: JsUint | null;
990
+ destination: string;
991
+ initiatorType: string | null;
919
992
  timings: Network.FetchTimingInfo;
920
993
  };
921
994
  }
@@ -1121,7 +1194,7 @@ export declare namespace Network {
1121
1194
  }
1122
1195
  export declare namespace Network {
1123
1196
  type BeforeRequestSentParameters = Network.BaseParameters & {
1124
- initiator: Network.Initiator;
1197
+ initiator?: Network.Initiator;
1125
1198
  };
1126
1199
  }
1127
1200
  export declare namespace Network {
@@ -2185,3 +2258,60 @@ export declare namespace Input {
2185
2258
  files: [...string[]];
2186
2259
  };
2187
2260
  }
2261
+ export type WebExtensionsCommand = WebExtension.Install &
2262
+ WebExtension.Uninstall;
2263
+ export type WebExtensionsResult = WebExtension.InstallResult;
2264
+ export declare namespace WebExtension {
2265
+ type Extension = string;
2266
+ }
2267
+ export declare namespace WebExtension {
2268
+ type InstallParameters = {
2269
+ extensionData: WebExtension.ExtensionData;
2270
+ };
2271
+ }
2272
+ export declare namespace WebExtension {
2273
+ type Install = {
2274
+ method: 'webExtension.install';
2275
+ params: WebExtension.InstallParameters;
2276
+ };
2277
+ }
2278
+ export declare namespace WebExtension {
2279
+ type ExtensionData =
2280
+ | WebExtension.ExtensionArchivePath
2281
+ | WebExtension.ExtensionBase64Encoded
2282
+ | WebExtension.ExtensionPath;
2283
+ }
2284
+ export declare namespace WebExtension {
2285
+ type ExtensionPath = {
2286
+ type: 'path';
2287
+ path: string;
2288
+ };
2289
+ }
2290
+ export declare namespace WebExtension {
2291
+ type ExtensionArchivePath = {
2292
+ type: 'archivePath';
2293
+ path: string;
2294
+ };
2295
+ }
2296
+ export declare namespace WebExtension {
2297
+ type ExtensionBase64Encoded = {
2298
+ type: 'base64';
2299
+ value: string;
2300
+ };
2301
+ }
2302
+ export declare namespace WebExtension {
2303
+ type InstallResult = {
2304
+ extension: WebExtension.Extension;
2305
+ };
2306
+ }
2307
+ export declare namespace WebExtension {
2308
+ type Uninstall = {
2309
+ method: 'webExtension.uninstall';
2310
+ params: WebExtension.UninstallParameters;
2311
+ };
2312
+ }
2313
+ export declare namespace WebExtension {
2314
+ type UninstallParameters = {
2315
+ extension: WebExtension.Extension;
2316
+ };
2317
+ }
@@ -0,0 +1,114 @@
1
+ export declare namespace Bluetooth {
2
+ type BluetoothServiceUuid = string;
3
+ }
4
+ export declare namespace Bluetooth {
5
+ type BluetoothManufacturerData = {
6
+ key: number;
7
+ data: string;
8
+ };
9
+ }
10
+ export declare namespace Bluetooth {
11
+ type RequestDevice = string;
12
+ }
13
+ export declare namespace Bluetooth {
14
+ type RequestDeviceInfo = {
15
+ id: Bluetooth.RequestDevice;
16
+ name: string | null;
17
+ };
18
+ }
19
+ export declare namespace Bluetooth {
20
+ type RequestDevicePrompt = string;
21
+ }
22
+ export declare namespace Bluetooth {
23
+ type ScanRecord = {
24
+ name?: string;
25
+ uuids?: [...Bluetooth.BluetoothServiceUuid[]];
26
+ appearance?: number;
27
+ manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]];
28
+ };
29
+ }
30
+ export declare namespace Bluetooth {
31
+ type HandleRequestDevicePrompt = {
32
+ method: 'bluetooth.handleRequestDevicePrompt';
33
+ params: Bluetooth.HandleRequestDevicePromptParameters;
34
+ };
35
+ }
36
+ export declare namespace Bluetooth {
37
+ type HandleRequestDevicePromptParameters = {
38
+ context: string;
39
+ prompt: Bluetooth.RequestDevicePrompt;
40
+ } & (
41
+ | Bluetooth.HandleRequestDevicePromptAcceptParameters
42
+ | Bluetooth.HandleRequestDevicePromptCancelParameters
43
+ );
44
+ }
45
+ export declare namespace Bluetooth {
46
+ type HandleRequestDevicePromptAcceptParameters = {
47
+ accept: true;
48
+ device: Bluetooth.RequestDevice;
49
+ };
50
+ }
51
+ export declare namespace Bluetooth {
52
+ type HandleRequestDevicePromptCancelParameters = {
53
+ accept: false;
54
+ };
55
+ }
56
+ export declare namespace Bluetooth {
57
+ type SimulateAdapter = {
58
+ method: 'bluetooth.simulateAdapter';
59
+ params: Bluetooth.SimulateAdapterParameters;
60
+ };
61
+ }
62
+ export declare namespace Bluetooth {
63
+ type SimulateAdapterParameters = {
64
+ context: string;
65
+ state: 'absent' | 'powered-off' | 'powered-on';
66
+ };
67
+ }
68
+ export declare namespace Bluetooth {
69
+ type SimulatePreconnectedPeripheral = {
70
+ method: 'bluetooth.simulatePreconnectedPeripheral';
71
+ params: Bluetooth.SimulatePreconnectedPeripheralParameters;
72
+ };
73
+ }
74
+ export declare namespace Bluetooth {
75
+ type SimulatePreconnectedPeripheralParameters = {
76
+ context: string;
77
+ address: string;
78
+ name: string;
79
+ manufacturerData: [...Bluetooth.BluetoothManufacturerData[]];
80
+ knownServiceUuids: [...Bluetooth.BluetoothServiceUuid[]];
81
+ };
82
+ }
83
+ export declare namespace Bluetooth {
84
+ type SimulateAdvertisement = {
85
+ method: 'bluetooth.simulateAdvertisement';
86
+ params: Bluetooth.SimulateAdvertisementParameters;
87
+ };
88
+ }
89
+ export declare namespace Bluetooth {
90
+ type SimulateAdvertisementParameters = {
91
+ context: string;
92
+ scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters;
93
+ };
94
+ }
95
+ export declare namespace Bluetooth {
96
+ type SimulateAdvertisementScanEntryParameters = {
97
+ deviceAddress: string;
98
+ rssi: number;
99
+ scanRecord: Bluetooth.ScanRecord;
100
+ };
101
+ }
102
+ export declare namespace Bluetooth {
103
+ type RequestDevicePromptUpdated = {
104
+ method: 'bluetooth.requestDevicePromptUpdated';
105
+ params: Bluetooth.RequestDevicePromptUpdatedParameters;
106
+ };
107
+ }
108
+ export declare namespace Bluetooth {
109
+ type RequestDevicePromptUpdatedParameters = {
110
+ context: string;
111
+ prompt: Bluetooth.RequestDevicePrompt;
112
+ devices: [...Bluetooth.RequestDeviceInfo[]];
113
+ };
114
+ }
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', {value: true});
package/out/index.d.ts CHANGED
@@ -5,29 +5,38 @@
5
5
  */
6
6
  import * as Bidi from './gen/main.js';
7
7
  import * as BidiPermissions from './gen/permissions.js';
8
+ import * as BidiBluetooth from './gen/web-bluetooth.js';
8
9
  export * from './gen/main.js';
9
10
  export * from './gen/permissions.js';
10
- export type Command = Bidi.Command | BidiPermissions.Permissions.SetPermission;
11
- export type Event = Bidi.Event;
11
+ export * from './gen/web-bluetooth.js';
12
+ export type Command =
13
+ | Bidi.Command
14
+ | BidiPermissions.Permissions.SetPermission
15
+ | BidiBluetooth.Bluetooth.SimulateAdapter
16
+ | BidiBluetooth.Bluetooth.HandleRequestDevicePrompt
17
+ | BidiBluetooth.Bluetooth.SimulateAdvertisement
18
+ | BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheral;
19
+ export type Event =
20
+ | Bidi.Event
21
+ | ({
22
+ type: 'event';
23
+ } & BidiBluetooth.Bluetooth.RequestDevicePromptUpdated &
24
+ Bidi.Extensible);
12
25
  export interface Commands {
13
- 'script.evaluate': {
14
- params: Bidi.Script.EvaluateParameters;
15
- returnType: Bidi.Script.EvaluateResult;
16
- };
17
- 'script.callFunction': {
18
- params: Bidi.Script.CallFunctionParameters;
19
- returnType: Bidi.Script.EvaluateResult;
26
+ 'bluetooth.handleRequestDevicePrompt': {
27
+ params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
28
+ returnType: Bidi.EmptyResult;
20
29
  };
21
- 'script.disown': {
22
- params: Bidi.Script.DisownParameters;
30
+ 'bluetooth.simulateAdapter': {
31
+ params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
23
32
  returnType: Bidi.EmptyResult;
24
33
  };
25
- 'script.addPreloadScript': {
26
- params: Bidi.Script.AddPreloadScriptParameters;
27
- returnType: Bidi.Script.AddPreloadScriptResult;
34
+ 'bluetooth.simulateAdvertisement': {
35
+ params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
36
+ returnType: Bidi.EmptyResult;
28
37
  };
29
- 'script.removePreloadScript': {
30
- params: Bidi.Script.RemovePreloadScriptParameters;
38
+ 'bluetooth.simulatePreconnectedPeripheral': {
39
+ params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheral;
31
40
  returnType: Bidi.EmptyResult;
32
41
  };
33
42
  'browser.close': {
@@ -112,6 +121,26 @@ export interface Commands {
112
121
  params: BidiPermissions.Permissions.SetPermissionParameters;
113
122
  returnType: Bidi.EmptyResult;
114
123
  };
124
+ 'script.evaluate': {
125
+ params: Bidi.Script.EvaluateParameters;
126
+ returnType: Bidi.Script.EvaluateResult;
127
+ };
128
+ 'script.callFunction': {
129
+ params: Bidi.Script.CallFunctionParameters;
130
+ returnType: Bidi.Script.EvaluateResult;
131
+ };
132
+ 'script.disown': {
133
+ params: Bidi.Script.DisownParameters;
134
+ returnType: Bidi.EmptyResult;
135
+ };
136
+ 'script.addPreloadScript': {
137
+ params: Bidi.Script.AddPreloadScriptParameters;
138
+ returnType: Bidi.Script.AddPreloadScriptResult;
139
+ };
140
+ 'script.removePreloadScript': {
141
+ params: Bidi.Script.RemovePreloadScriptParameters;
142
+ returnType: Bidi.EmptyResult;
143
+ };
115
144
  'session.end': {
116
145
  params: Bidi.EmptyParams;
117
146
  returnType: Bidi.EmptyResult;
@@ -168,4 +197,12 @@ export interface Commands {
168
197
  params: Bidi.Network.ProvideResponseParameters;
169
198
  returnType: Bidi.EmptyResult;
170
199
  };
200
+ 'webExtension.install': {
201
+ params: Bidi.WebExtension.InstallParameters;
202
+ returnType: Bidi.WebExtension.InstallResult;
203
+ };
204
+ 'webExtension.uninstall': {
205
+ params: Bidi.WebExtension.UninstallParameters;
206
+ returnType: Bidi.EmptyResult;
207
+ };
171
208
  }
package/out/index.js CHANGED
@@ -37,3 +37,4 @@ var __exportStar =
37
37
  Object.defineProperty(exports, '__esModule', {value: true});
38
38
  __exportStar(require('./gen/main.js'), exports);
39
39
  __exportStar(require('./gen/permissions.js'), exports);
40
+ __exportStar(require('./gen/web-bluetooth.js'), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdriver-bidi-protocol",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "url": "git+https://github.com/GoogleChromeLabs/webdriver-bidi-protocol.git"
21
21
  },
22
22
  "devDependencies": {
23
- "@types/node": "^20.12.12",
24
- "gts": "^5.3.1",
23
+ "@types/node": "^22.5.2",
24
+ "gts": "^6.0.2",
25
25
  "parse5": "^7.1.2",
26
- "prettier": "3.3.2",
27
- "tsd": "0.31.1",
28
- "typescript": "5.5.3"
26
+ "prettier": "3.4.1",
27
+ "tsd": "0.31.2",
28
+ "typescript": "5.7.2"
29
29
  }
30
30
  }
package/src/gen/main.ts CHANGED
@@ -58,6 +58,7 @@ export const enum ErrorCode {
58
58
  InvalidArgument = 'invalid argument',
59
59
  InvalidSelector = 'invalid selector',
60
60
  InvalidSessionId = 'invalid session id',
61
+ InvalidWebExtension = 'invalid web extension',
61
62
  MoveTargetOutOfBounds = 'move target out of bounds',
62
63
  NoSuchAlert = 'no such alert',
63
64
  NoSuchElement = 'no such element',
@@ -70,6 +71,7 @@ export const enum ErrorCode {
70
71
  NoSuchScript = 'no such script',
71
72
  NoSuchStoragePartition = 'no such storage partition',
72
73
  NoSuchUserContext = 'no such user context',
74
+ NoSuchWebExtension = 'no such web extension',
73
75
  SessionNotCreated = 'session not created',
74
76
  UnableToCaptureScreen = 'unable to capture screen',
75
77
  UnableToCloseBrowser = 'unable to close browser',
@@ -237,11 +239,28 @@ export namespace Session {
237
239
  export type BrowserCommand =
238
240
  | Browser.Close
239
241
  | Browser.CreateUserContext
242
+ | Browser.GetClientWindows
240
243
  | Browser.GetUserContexts
241
- | Browser.RemoveUserContext;
244
+ | Browser.RemoveUserContext
245
+ | Browser.SetClientWindowState
246
+ | Record<string, never>;
242
247
  export type BrowserResult =
243
248
  | Browser.CreateUserContextResult
244
249
  | Browser.GetUserContextsResult;
250
+ export namespace Browser {
251
+ export type ClientWindow = string;
252
+ }
253
+ export namespace Browser {
254
+ export type ClientWindowInfo = {
255
+ active: boolean;
256
+ clientWindow: Browser.ClientWindow;
257
+ height: JsUint;
258
+ state: 'fullscreen' | 'maximized' | 'minimized' | 'normal';
259
+ width: JsUint;
260
+ x: JsInt;
261
+ y: JsInt;
262
+ };
263
+ }
245
264
  export namespace Browser {
246
265
  export type UserContext = string;
247
266
  }
@@ -265,6 +284,17 @@ export namespace Browser {
265
284
  export namespace Browser {
266
285
  export type CreateUserContextResult = Browser.UserContextInfo;
267
286
  }
287
+ export namespace Browser {
288
+ export type GetClientWindows = {
289
+ method: 'browser.getClientWindows';
290
+ params: EmptyParams;
291
+ };
292
+ }
293
+ export namespace Browser {
294
+ export type GetClientWindowsResult = {
295
+ clientWindows: [...Browser.ClientWindowInfo[]];
296
+ };
297
+ }
268
298
  export namespace Browser {
269
299
  export type GetUserContexts = {
270
300
  method: 'browser.getUserContexts';
@@ -287,6 +317,33 @@ export namespace Browser {
287
317
  userContext: Browser.UserContext;
288
318
  };
289
319
  }
320
+ export namespace Browser {
321
+ export type SetClientWindowState = {
322
+ method: 'browser.setClientWindowState';
323
+ params: Browser.SetClientWindowStateParameters;
324
+ };
325
+ }
326
+ export namespace Browser {
327
+ export type SetClientWindowStateParameters =
328
+ | ({
329
+ clientWindow: Browser.ClientWindow;
330
+ } & Browser.ClientWindowNamedState)
331
+ | Browser.ClientWindowRectState;
332
+ }
333
+ export namespace Browser {
334
+ export type ClientWindowNamedState = {
335
+ state: 'fullscreen' | 'maximized' | 'minimized';
336
+ };
337
+ }
338
+ export namespace Browser {
339
+ export type ClientWindowRectState = {
340
+ state: 'normal';
341
+ width?: JsUint;
342
+ height?: JsUint;
343
+ x?: JsInt;
344
+ y?: JsInt;
345
+ };
346
+ }
290
347
  export type BrowsingContextCommand =
291
348
  | BrowsingContext.Activate
292
349
  | BrowsingContext.CaptureScreenshot
@@ -306,6 +363,7 @@ export type BrowsingContextEvent =
306
363
  | BrowsingContext.DomContentLoaded
307
364
  | BrowsingContext.DownloadWillBegin
308
365
  | BrowsingContext.FragmentNavigated
366
+ | BrowsingContext.HistoryUpdated
309
367
  | BrowsingContext.Load
310
368
  | BrowsingContext.NavigationAborted
311
369
  | BrowsingContext.NavigationFailed
@@ -329,6 +387,7 @@ export namespace BrowsingContext {
329
387
  export namespace BrowsingContext {
330
388
  export type Info = {
331
389
  children: BrowsingContext.InfoList | null;
390
+ clientWindow: Browser.ClientWindow;
332
391
  context: BrowsingContext.BrowsingContext;
333
392
  originalOpener: BrowsingContext.BrowsingContext | null;
334
393
  url: string;
@@ -731,6 +790,18 @@ export namespace BrowsingContext {
731
790
  params: BrowsingContext.NavigationInfo;
732
791
  };
733
792
  }
793
+ export namespace BrowsingContext {
794
+ export type HistoryUpdated = {
795
+ method: 'browsingContext.historyUpdated';
796
+ params: BrowsingContext.HistoryUpdatedParameters;
797
+ };
798
+ }
799
+ export namespace BrowsingContext {
800
+ export type HistoryUpdatedParameters = {
801
+ context: BrowsingContext.BrowsingContext;
802
+ url: string;
803
+ };
804
+ }
734
805
  export namespace BrowsingContext {
735
806
  export type DomContentLoaded = {
736
807
  method: 'browsingContext.domContentLoaded';
@@ -896,11 +967,11 @@ export namespace Network {
896
967
  }
897
968
  export namespace Network {
898
969
  export type Initiator = {
899
- type: 'parser' | 'script' | 'preflight' | 'other';
900
970
  columnNumber?: JsUint;
901
971
  lineNumber?: JsUint;
902
- stackTrace?: Script.StackTrace;
903
972
  request?: Network.Request;
973
+ stackTrace?: Script.StackTrace;
974
+ type?: 'parser' | 'script' | 'preflight' | 'other';
904
975
  };
905
976
  }
906
977
  export namespace Network {
@@ -918,6 +989,8 @@ export namespace Network {
918
989
  cookies: [...Network.Cookie[]];
919
990
  headersSize: JsUint;
920
991
  bodySize: JsUint | null;
992
+ destination: string;
993
+ initiatorType: string | null;
921
994
  timings: Network.FetchTimingInfo;
922
995
  };
923
996
  }
@@ -1123,7 +1196,7 @@ export namespace Network {
1123
1196
  }
1124
1197
  export namespace Network {
1125
1198
  export type BeforeRequestSentParameters = Network.BaseParameters & {
1126
- initiator: Network.Initiator;
1199
+ initiator?: Network.Initiator;
1127
1200
  };
1128
1201
  }
1129
1202
  export namespace Network {
@@ -2189,3 +2262,60 @@ export namespace Input {
2189
2262
  files: [...string[]];
2190
2263
  };
2191
2264
  }
2265
+ export type WebExtensionsCommand = WebExtension.Install &
2266
+ WebExtension.Uninstall;
2267
+ export type WebExtensionsResult = WebExtension.InstallResult;
2268
+ export namespace WebExtension {
2269
+ export type Extension = string;
2270
+ }
2271
+ export namespace WebExtension {
2272
+ export type InstallParameters = {
2273
+ extensionData: WebExtension.ExtensionData;
2274
+ };
2275
+ }
2276
+ export namespace WebExtension {
2277
+ export type Install = {
2278
+ method: 'webExtension.install';
2279
+ params: WebExtension.InstallParameters;
2280
+ };
2281
+ }
2282
+ export namespace WebExtension {
2283
+ export type ExtensionData =
2284
+ | WebExtension.ExtensionArchivePath
2285
+ | WebExtension.ExtensionBase64Encoded
2286
+ | WebExtension.ExtensionPath;
2287
+ }
2288
+ export namespace WebExtension {
2289
+ export type ExtensionPath = {
2290
+ type: 'path';
2291
+ path: string;
2292
+ };
2293
+ }
2294
+ export namespace WebExtension {
2295
+ export type ExtensionArchivePath = {
2296
+ type: 'archivePath';
2297
+ path: string;
2298
+ };
2299
+ }
2300
+ export namespace WebExtension {
2301
+ export type ExtensionBase64Encoded = {
2302
+ type: 'base64';
2303
+ value: string;
2304
+ };
2305
+ }
2306
+ export namespace WebExtension {
2307
+ export type InstallResult = {
2308
+ extension: WebExtension.Extension;
2309
+ };
2310
+ }
2311
+ export namespace WebExtension {
2312
+ export type Uninstall = {
2313
+ method: 'webExtension.uninstall';
2314
+ params: WebExtension.UninstallParameters;
2315
+ };
2316
+ }
2317
+ export namespace WebExtension {
2318
+ export type UninstallParameters = {
2319
+ extension: WebExtension.Extension;
2320
+ };
2321
+ }
@@ -0,0 +1,114 @@
1
+ export namespace Bluetooth {
2
+ export type BluetoothServiceUuid = string;
3
+ }
4
+ export namespace Bluetooth {
5
+ export type BluetoothManufacturerData = {
6
+ key: number;
7
+ data: string;
8
+ };
9
+ }
10
+ export namespace Bluetooth {
11
+ export type RequestDevice = string;
12
+ }
13
+ export namespace Bluetooth {
14
+ export type RequestDeviceInfo = {
15
+ id: Bluetooth.RequestDevice;
16
+ name: string | null;
17
+ };
18
+ }
19
+ export namespace Bluetooth {
20
+ export type RequestDevicePrompt = string;
21
+ }
22
+ export namespace Bluetooth {
23
+ export type ScanRecord = {
24
+ name?: string;
25
+ uuids?: [...Bluetooth.BluetoothServiceUuid[]];
26
+ appearance?: number;
27
+ manufacturerData?: [...Bluetooth.BluetoothManufacturerData[]];
28
+ };
29
+ }
30
+ export namespace Bluetooth {
31
+ export type HandleRequestDevicePrompt = {
32
+ method: 'bluetooth.handleRequestDevicePrompt';
33
+ params: Bluetooth.HandleRequestDevicePromptParameters;
34
+ };
35
+ }
36
+ export namespace Bluetooth {
37
+ export type HandleRequestDevicePromptParameters = {
38
+ context: string;
39
+ prompt: Bluetooth.RequestDevicePrompt;
40
+ } & (
41
+ | Bluetooth.HandleRequestDevicePromptAcceptParameters
42
+ | Bluetooth.HandleRequestDevicePromptCancelParameters
43
+ );
44
+ }
45
+ export namespace Bluetooth {
46
+ export type HandleRequestDevicePromptAcceptParameters = {
47
+ accept: true;
48
+ device: Bluetooth.RequestDevice;
49
+ };
50
+ }
51
+ export namespace Bluetooth {
52
+ export type HandleRequestDevicePromptCancelParameters = {
53
+ accept: false;
54
+ };
55
+ }
56
+ export namespace Bluetooth {
57
+ export type SimulateAdapter = {
58
+ method: 'bluetooth.simulateAdapter';
59
+ params: Bluetooth.SimulateAdapterParameters;
60
+ };
61
+ }
62
+ export namespace Bluetooth {
63
+ export type SimulateAdapterParameters = {
64
+ context: string;
65
+ state: 'absent' | 'powered-off' | 'powered-on';
66
+ };
67
+ }
68
+ export namespace Bluetooth {
69
+ export type SimulatePreconnectedPeripheral = {
70
+ method: 'bluetooth.simulatePreconnectedPeripheral';
71
+ params: Bluetooth.SimulatePreconnectedPeripheralParameters;
72
+ };
73
+ }
74
+ export namespace Bluetooth {
75
+ export type SimulatePreconnectedPeripheralParameters = {
76
+ context: string;
77
+ address: string;
78
+ name: string;
79
+ manufacturerData: [...Bluetooth.BluetoothManufacturerData[]];
80
+ knownServiceUuids: [...Bluetooth.BluetoothServiceUuid[]];
81
+ };
82
+ }
83
+ export namespace Bluetooth {
84
+ export type SimulateAdvertisement = {
85
+ method: 'bluetooth.simulateAdvertisement';
86
+ params: Bluetooth.SimulateAdvertisementParameters;
87
+ };
88
+ }
89
+ export namespace Bluetooth {
90
+ export type SimulateAdvertisementParameters = {
91
+ context: string;
92
+ scanEntry: Bluetooth.SimulateAdvertisementScanEntryParameters;
93
+ };
94
+ }
95
+ export namespace Bluetooth {
96
+ export type SimulateAdvertisementScanEntryParameters = {
97
+ deviceAddress: string;
98
+ rssi: number;
99
+ scanRecord: Bluetooth.ScanRecord;
100
+ };
101
+ }
102
+ export namespace Bluetooth {
103
+ export type RequestDevicePromptUpdated = {
104
+ method: 'bluetooth.requestDevicePromptUpdated';
105
+ params: Bluetooth.RequestDevicePromptUpdatedParameters;
106
+ };
107
+ }
108
+ export namespace Bluetooth {
109
+ export type RequestDevicePromptUpdatedParameters = {
110
+ context: string;
111
+ prompt: Bluetooth.RequestDevicePrompt;
112
+ devices: [...Bluetooth.RequestDeviceInfo[]];
113
+ };
114
+ }
package/src/index.ts CHANGED
@@ -6,33 +6,42 @@
6
6
 
7
7
  import * as Bidi from './gen/main.js';
8
8
  import * as BidiPermissions from './gen/permissions.js';
9
+ import * as BidiBluetooth from './gen/web-bluetooth.js';
9
10
 
10
11
  export * from './gen/main.js';
11
12
  export * from './gen/permissions.js';
13
+ export * from './gen/web-bluetooth.js';
12
14
 
13
- export type Command = Bidi.Command | BidiPermissions.Permissions.SetPermission;
14
- export type Event = Bidi.Event;
15
+ export type Command =
16
+ | Bidi.Command
17
+ | BidiPermissions.Permissions.SetPermission
18
+ | BidiBluetooth.Bluetooth.SimulateAdapter
19
+ | BidiBluetooth.Bluetooth.HandleRequestDevicePrompt
20
+ | BidiBluetooth.Bluetooth.SimulateAdvertisement
21
+ | BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheral;
22
+ export type Event =
23
+ | Bidi.Event
24
+ | ({
25
+ type: 'event';
26
+ } & BidiBluetooth.Bluetooth.RequestDevicePromptUpdated &
27
+ Bidi.Extensible);
15
28
 
16
29
  // TODO: is there a way to generate this mapping?
17
30
  export interface Commands {
18
- 'script.evaluate': {
19
- params: Bidi.Script.EvaluateParameters;
20
- returnType: Bidi.Script.EvaluateResult;
21
- };
22
- 'script.callFunction': {
23
- params: Bidi.Script.CallFunctionParameters;
24
- returnType: Bidi.Script.EvaluateResult;
31
+ 'bluetooth.handleRequestDevicePrompt': {
32
+ params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
33
+ returnType: Bidi.EmptyResult;
25
34
  };
26
- 'script.disown': {
27
- params: Bidi.Script.DisownParameters;
35
+ 'bluetooth.simulateAdapter': {
36
+ params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
28
37
  returnType: Bidi.EmptyResult;
29
38
  };
30
- 'script.addPreloadScript': {
31
- params: Bidi.Script.AddPreloadScriptParameters;
32
- returnType: Bidi.Script.AddPreloadScriptResult;
39
+ 'bluetooth.simulateAdvertisement': {
40
+ params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
41
+ returnType: Bidi.EmptyResult;
33
42
  };
34
- 'script.removePreloadScript': {
35
- params: Bidi.Script.RemovePreloadScriptParameters;
43
+ 'bluetooth.simulatePreconnectedPeripheral': {
44
+ params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheral;
36
45
  returnType: Bidi.EmptyResult;
37
46
  };
38
47
 
@@ -40,7 +49,6 @@ export interface Commands {
40
49
  params: Bidi.EmptyParams;
41
50
  returnType: Bidi.EmptyResult;
42
51
  };
43
-
44
52
  'browser.createUserContext': {
45
53
  params: Bidi.EmptyParams;
46
54
  returnType: Bidi.Browser.CreateUserContextResult;
@@ -123,6 +131,27 @@ export interface Commands {
123
131
  returnType: Bidi.EmptyResult;
124
132
  };
125
133
 
134
+ 'script.evaluate': {
135
+ params: Bidi.Script.EvaluateParameters;
136
+ returnType: Bidi.Script.EvaluateResult;
137
+ };
138
+ 'script.callFunction': {
139
+ params: Bidi.Script.CallFunctionParameters;
140
+ returnType: Bidi.Script.EvaluateResult;
141
+ };
142
+ 'script.disown': {
143
+ params: Bidi.Script.DisownParameters;
144
+ returnType: Bidi.EmptyResult;
145
+ };
146
+ 'script.addPreloadScript': {
147
+ params: Bidi.Script.AddPreloadScriptParameters;
148
+ returnType: Bidi.Script.AddPreloadScriptResult;
149
+ };
150
+ 'script.removePreloadScript': {
151
+ params: Bidi.Script.RemovePreloadScriptParameters;
152
+ returnType: Bidi.EmptyResult;
153
+ };
154
+
126
155
  'session.end': {
127
156
  params: Bidi.EmptyParams;
128
157
  returnType: Bidi.EmptyResult;
@@ -181,4 +210,13 @@ export interface Commands {
181
210
  params: Bidi.Network.ProvideResponseParameters;
182
211
  returnType: Bidi.EmptyResult;
183
212
  };
213
+
214
+ 'webExtension.install': {
215
+ params: Bidi.WebExtension.InstallParameters;
216
+ returnType: Bidi.WebExtension.InstallResult;
217
+ };
218
+ 'webExtension.uninstall': {
219
+ params: Bidi.WebExtension.UninstallParameters;
220
+ returnType: Bidi.EmptyResult;
221
+ };
184
222
  }
@@ -42,5 +42,21 @@ handleEvent({
42
42
  url: '',
43
43
  userContext: '',
44
44
  originalOpener: null,
45
+ clientWindow: '',
46
+ },
47
+ });
48
+
49
+ sendCommandMultipleArgs('bluetooth.simulateAdapter', {
50
+ context: '',
51
+ state: 'powered-on',
52
+ });
53
+
54
+ handleEvent({
55
+ type: 'event',
56
+ method: 'bluetooth.requestDevicePromptUpdated',
57
+ params: {
58
+ context: '',
59
+ prompt: '',
60
+ devices: [],
45
61
  },
46
62
  });
package/tools/build.sh CHANGED
@@ -11,12 +11,15 @@ git submodule update --init
11
11
 
12
12
  (cd specs/webdriver-bidi && scripts/cddl/generate.js)
13
13
  (cd specs/permissions && ../webdriver-bidi/scripts/cddl/generate.js index.html)
14
+ (cd specs/web-bluetooth && ../webdriver-bidi/scripts/cddl/generate.js index.bs)
14
15
 
15
16
  cddlconv specs/webdriver-bidi/all.cddl > src/gen/main.ts
16
17
  cddlconv specs/permissions/all.cddl > src/gen/permissions.ts
18
+ cddlconv specs/web-bluetooth/all.cddl > src/gen/web-bluetooth.ts
17
19
 
18
20
  (cd specs/webdriver-bidi && git reset --hard HEAD && git clean -fd)
19
21
  (cd specs/permissions && git reset --hard HEAD && git clean -fd)
22
+ (cd specs/web-bluetooth && git reset --hard HEAD && git clean -fd)
20
23
 
21
24
  git submodule deinit --all
22
25