webdriver-bidi-protocol 0.0.8 → 0.1.1
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/.github/dependabot.yml +0 -3
- package/.github/workflows/ci.yml +2 -16
- package/.github/workflows/publish.yml +1 -1
- package/.github/workflows/release-please.yml +3 -5
- package/.gitmodules +3 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +38 -0
- package/README.md +7 -2
- package/out/gen/main.d.ts +139 -6
- package/out/gen/web-bluetooth.d.ts +114 -0
- package/out/gen/web-bluetooth.js +2 -0
- package/out/index.d.ts +53 -16
- package/out/index.js +1 -0
- package/package.json +6 -6
- package/src/gen/main.ts +139 -6
- package/src/gen/web-bluetooth.ts +114 -0
- package/src/index.ts +55 -17
- package/test-d/webdriver-bidi-protocol.test-d.ts +16 -0
- package/tools/build.sh +3 -0
package/.github/dependabot.yml
CHANGED
package/.github/workflows/ci.yml
CHANGED
|
@@ -21,26 +21,12 @@ jobs:
|
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
22
|
steps:
|
|
23
23
|
- name: Check out repository
|
|
24
|
-
uses: actions/checkout@
|
|
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
|
-
|
|
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@
|
|
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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.1](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.1.0...webdriver-bidi-protocol-v0.1.1) (2024-12-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* re-gen types based on the spec changes ([#75](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/75)) ([e95b00e](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/e95b00e96333781b8843325d928e75f49768f06f))
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add bluetooth ([#66](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/66)) ([e42e8d9](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/e42e8d9896540020955d81b08066bdf92ed16602))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add repository ([#19](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/19)) ([91def9d](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/91def9dd0baeab3476e7154676e40d5a709da2c3))
|
|
21
|
+
* another repository fix ([72c215c](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/72c215cbcf76c97317deff925d1ff73732ed5bab))
|
|
22
|
+
* 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))
|
|
23
|
+
* 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))
|
|
24
|
+
* 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))
|
|
25
|
+
* 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))
|
|
26
|
+
* 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))
|
|
27
|
+
* 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))
|
|
28
|
+
* 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))
|
|
29
|
+
* 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))
|
|
30
|
+
* document usage ([#7](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/7)) ([d98a6ee](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d98a6ee23cbaa943440e2b40831a0c56aa0d6c18))
|
|
31
|
+
* update repository ([28cf911](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/28cf911e59ad5b177df47d04fc012d8c9cfe7fde))
|
|
32
|
+
|
|
33
|
+
## [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)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* 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))
|
|
39
|
+
* 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))
|
|
40
|
+
|
|
3
41
|
## [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
42
|
|
|
5
43
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# webdriver-bidi-protocol
|
|
2
2
|
|
|
3
3
|
This repository contains TypeScript types conforming to the [WebDriver
|
|
4
|
-
BiDi](https://w3c.github.io/webdriver-bidi/) specification.
|
|
4
|
+
BiDi](https://w3c.github.io/webdriver-bidi/) specification. It also
|
|
5
|
+
supports WebDriver BiDi extension modules defined in other
|
|
6
|
+
specifications:
|
|
7
|
+
|
|
8
|
+
- [Permissions](https://w3c.github.io/permissions/#automation-webdriver-bidi)
|
|
9
|
+
- [Web Bluetooth](https://webbluetoothcg.github.io/web-bluetooth/#automated-testing)
|
|
5
10
|
|
|
6
11
|
## Installation
|
|
7
12
|
|
|
@@ -31,4 +36,4 @@ await sendCommand('browsingContext.print', {context: 'xxx'});
|
|
|
31
36
|
## Versioning
|
|
32
37
|
|
|
33
38
|
This package patch version will be incremented whenever there are
|
|
34
|
-
specification updates.
|
|
39
|
+
specification updates.
|
package/out/gen/main.d.ts
CHANGED
|
@@ -23,14 +23,16 @@ export type CommandData =
|
|
|
23
23
|
| NetworkCommand
|
|
24
24
|
| ScriptCommand
|
|
25
25
|
| SessionCommand
|
|
26
|
-
| StorageCommand
|
|
26
|
+
| StorageCommand
|
|
27
|
+
| WebExtensionsCommand;
|
|
27
28
|
export type ResultData =
|
|
28
29
|
| BrowsingContextResult
|
|
29
30
|
| EmptyResult
|
|
30
31
|
| NetworkResult
|
|
31
32
|
| ScriptResult
|
|
32
33
|
| SessionResult
|
|
33
|
-
| StorageResult
|
|
34
|
+
| StorageResult
|
|
35
|
+
| WebExtensionsResult;
|
|
34
36
|
export type EmptyParams = Extensible;
|
|
35
37
|
export type Message = CommandResponse | ErrorResponse | Event;
|
|
36
38
|
export type ErrorResponse = {
|
|
@@ -56,6 +58,7 @@ export declare const enum ErrorCode {
|
|
|
56
58
|
InvalidArgument = 'invalid argument',
|
|
57
59
|
InvalidSelector = 'invalid selector',
|
|
58
60
|
InvalidSessionId = 'invalid session id',
|
|
61
|
+
InvalidWebExtension = 'invalid web extension',
|
|
59
62
|
MoveTargetOutOfBounds = 'move target out of bounds',
|
|
60
63
|
NoSuchAlert = 'no such alert',
|
|
61
64
|
NoSuchElement = 'no such element',
|
|
@@ -68,6 +71,7 @@ export declare const enum ErrorCode {
|
|
|
68
71
|
NoSuchScript = 'no such script',
|
|
69
72
|
NoSuchStoragePartition = 'no such storage partition',
|
|
70
73
|
NoSuchUserContext = 'no such user context',
|
|
74
|
+
NoSuchWebExtension = 'no such web extension',
|
|
71
75
|
SessionNotCreated = 'session not created',
|
|
72
76
|
UnableToCaptureScreen = 'unable to capture screen',
|
|
73
77
|
UnableToCloseBrowser = 'unable to close browser',
|
|
@@ -235,11 +239,28 @@ export declare namespace Session {
|
|
|
235
239
|
export type BrowserCommand =
|
|
236
240
|
| Browser.Close
|
|
237
241
|
| Browser.CreateUserContext
|
|
242
|
+
| Browser.GetClientWindows
|
|
238
243
|
| Browser.GetUserContexts
|
|
239
|
-
| Browser.RemoveUserContext
|
|
244
|
+
| Browser.RemoveUserContext
|
|
245
|
+
| Browser.SetClientWindowState
|
|
246
|
+
| Record<string, never>;
|
|
240
247
|
export type BrowserResult =
|
|
241
248
|
| Browser.CreateUserContextResult
|
|
242
249
|
| Browser.GetUserContextsResult;
|
|
250
|
+
export declare namespace Browser {
|
|
251
|
+
type ClientWindow = string;
|
|
252
|
+
}
|
|
253
|
+
export declare namespace Browser {
|
|
254
|
+
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
|
+
}
|
|
243
264
|
export declare namespace Browser {
|
|
244
265
|
type UserContext = string;
|
|
245
266
|
}
|
|
@@ -263,6 +284,17 @@ export declare namespace Browser {
|
|
|
263
284
|
export declare namespace Browser {
|
|
264
285
|
type CreateUserContextResult = Browser.UserContextInfo;
|
|
265
286
|
}
|
|
287
|
+
export declare namespace Browser {
|
|
288
|
+
type GetClientWindows = {
|
|
289
|
+
method: 'browser.getClientWindows';
|
|
290
|
+
params: EmptyParams;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export declare namespace Browser {
|
|
294
|
+
type GetClientWindowsResult = {
|
|
295
|
+
clientWindows: [...Browser.ClientWindowInfo[]];
|
|
296
|
+
};
|
|
297
|
+
}
|
|
266
298
|
export declare namespace Browser {
|
|
267
299
|
type GetUserContexts = {
|
|
268
300
|
method: 'browser.getUserContexts';
|
|
@@ -285,6 +317,33 @@ export declare namespace Browser {
|
|
|
285
317
|
userContext: Browser.UserContext;
|
|
286
318
|
};
|
|
287
319
|
}
|
|
320
|
+
export declare namespace Browser {
|
|
321
|
+
type SetClientWindowState = {
|
|
322
|
+
method: 'browser.setClientWindowState';
|
|
323
|
+
params: Browser.SetClientWindowStateParameters;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export declare namespace Browser {
|
|
327
|
+
type SetClientWindowStateParameters =
|
|
328
|
+
| ({
|
|
329
|
+
clientWindow: Browser.ClientWindow;
|
|
330
|
+
} & Browser.ClientWindowNamedState)
|
|
331
|
+
| Browser.ClientWindowRectState;
|
|
332
|
+
}
|
|
333
|
+
export declare namespace Browser {
|
|
334
|
+
type ClientWindowNamedState = {
|
|
335
|
+
state: 'fullscreen' | 'maximized' | 'minimized';
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
export declare namespace Browser {
|
|
339
|
+
type ClientWindowRectState = {
|
|
340
|
+
state: 'normal';
|
|
341
|
+
width?: JsUint;
|
|
342
|
+
height?: JsUint;
|
|
343
|
+
x?: JsInt;
|
|
344
|
+
y?: JsInt;
|
|
345
|
+
};
|
|
346
|
+
}
|
|
288
347
|
export type BrowsingContextCommand =
|
|
289
348
|
| BrowsingContext.Activate
|
|
290
349
|
| BrowsingContext.CaptureScreenshot
|
|
@@ -304,6 +363,7 @@ export type BrowsingContextEvent =
|
|
|
304
363
|
| BrowsingContext.DomContentLoaded
|
|
305
364
|
| BrowsingContext.DownloadWillBegin
|
|
306
365
|
| BrowsingContext.FragmentNavigated
|
|
366
|
+
| BrowsingContext.HistoryUpdated
|
|
307
367
|
| BrowsingContext.Load
|
|
308
368
|
| BrowsingContext.NavigationAborted
|
|
309
369
|
| BrowsingContext.NavigationFailed
|
|
@@ -327,6 +387,7 @@ export declare namespace BrowsingContext {
|
|
|
327
387
|
export declare namespace BrowsingContext {
|
|
328
388
|
type Info = {
|
|
329
389
|
children: BrowsingContext.InfoList | null;
|
|
390
|
+
clientWindow: Browser.ClientWindow;
|
|
330
391
|
context: BrowsingContext.BrowsingContext;
|
|
331
392
|
originalOpener: BrowsingContext.BrowsingContext | null;
|
|
332
393
|
url: string;
|
|
@@ -729,6 +790,18 @@ export declare namespace BrowsingContext {
|
|
|
729
790
|
params: BrowsingContext.NavigationInfo;
|
|
730
791
|
};
|
|
731
792
|
}
|
|
793
|
+
export declare namespace BrowsingContext {
|
|
794
|
+
type HistoryUpdated = {
|
|
795
|
+
method: 'browsingContext.historyUpdated';
|
|
796
|
+
params: BrowsingContext.HistoryUpdatedParameters;
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
export declare namespace BrowsingContext {
|
|
800
|
+
type HistoryUpdatedParameters = {
|
|
801
|
+
context: BrowsingContext.BrowsingContext;
|
|
802
|
+
url: string;
|
|
803
|
+
};
|
|
804
|
+
}
|
|
732
805
|
export declare namespace BrowsingContext {
|
|
733
806
|
type DomContentLoaded = {
|
|
734
807
|
method: 'browsingContext.domContentLoaded';
|
|
@@ -894,11 +967,11 @@ export declare namespace Network {
|
|
|
894
967
|
}
|
|
895
968
|
export declare namespace Network {
|
|
896
969
|
type Initiator = {
|
|
897
|
-
type: 'parser' | 'script' | 'preflight' | 'other';
|
|
898
970
|
columnNumber?: JsUint;
|
|
899
971
|
lineNumber?: JsUint;
|
|
900
|
-
stackTrace?: Script.StackTrace;
|
|
901
972
|
request?: Network.Request;
|
|
973
|
+
stackTrace?: Script.StackTrace;
|
|
974
|
+
type?: 'parser' | 'script' | 'preflight' | 'other';
|
|
902
975
|
};
|
|
903
976
|
}
|
|
904
977
|
export declare namespace Network {
|
|
@@ -916,6 +989,8 @@ export declare namespace Network {
|
|
|
916
989
|
cookies: [...Network.Cookie[]];
|
|
917
990
|
headersSize: JsUint;
|
|
918
991
|
bodySize: JsUint | null;
|
|
992
|
+
destination: string;
|
|
993
|
+
initiatorType: string | null;
|
|
919
994
|
timings: Network.FetchTimingInfo;
|
|
920
995
|
};
|
|
921
996
|
}
|
|
@@ -1121,7 +1196,7 @@ export declare namespace Network {
|
|
|
1121
1196
|
}
|
|
1122
1197
|
export declare namespace Network {
|
|
1123
1198
|
type BeforeRequestSentParameters = Network.BaseParameters & {
|
|
1124
|
-
initiator
|
|
1199
|
+
initiator?: Network.Initiator;
|
|
1125
1200
|
};
|
|
1126
1201
|
}
|
|
1127
1202
|
export declare namespace Network {
|
|
@@ -2185,3 +2260,61 @@ export declare namespace Input {
|
|
|
2185
2260
|
files: [...string[]];
|
|
2186
2261
|
};
|
|
2187
2262
|
}
|
|
2263
|
+
export type WebExtensionsCommand =
|
|
2264
|
+
| WebExtension.Install
|
|
2265
|
+
| WebExtension.Uninstall;
|
|
2266
|
+
export type WebExtensionsResult = WebExtension.InstallResult;
|
|
2267
|
+
export declare namespace WebExtension {
|
|
2268
|
+
type Extension = string;
|
|
2269
|
+
}
|
|
2270
|
+
export declare namespace WebExtension {
|
|
2271
|
+
type InstallParameters = {
|
|
2272
|
+
extensionData: WebExtension.ExtensionData;
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
export declare namespace WebExtension {
|
|
2276
|
+
type Install = {
|
|
2277
|
+
method: 'webExtension.install';
|
|
2278
|
+
params: WebExtension.InstallParameters;
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
export declare namespace WebExtension {
|
|
2282
|
+
type ExtensionData =
|
|
2283
|
+
| WebExtension.ExtensionArchivePath
|
|
2284
|
+
| WebExtension.ExtensionBase64Encoded
|
|
2285
|
+
| WebExtension.ExtensionPath;
|
|
2286
|
+
}
|
|
2287
|
+
export declare namespace WebExtension {
|
|
2288
|
+
type ExtensionPath = {
|
|
2289
|
+
type: 'path';
|
|
2290
|
+
path: string;
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
export declare namespace WebExtension {
|
|
2294
|
+
type ExtensionArchivePath = {
|
|
2295
|
+
type: 'archivePath';
|
|
2296
|
+
path: string;
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
export declare namespace WebExtension {
|
|
2300
|
+
type ExtensionBase64Encoded = {
|
|
2301
|
+
type: 'base64';
|
|
2302
|
+
value: string;
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
export declare namespace WebExtension {
|
|
2306
|
+
type InstallResult = {
|
|
2307
|
+
extension: WebExtension.Extension;
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
export declare namespace WebExtension {
|
|
2311
|
+
type Uninstall = {
|
|
2312
|
+
method: 'webExtension.uninstall';
|
|
2313
|
+
params: WebExtension.UninstallParameters;
|
|
2314
|
+
};
|
|
2315
|
+
}
|
|
2316
|
+
export declare namespace WebExtension {
|
|
2317
|
+
type UninstallParameters = {
|
|
2318
|
+
extension: WebExtension.Extension;
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
@@ -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
|
+
}
|
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
|
|
11
|
-
export type
|
|
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
|
-
'
|
|
14
|
-
params:
|
|
15
|
-
returnType: Bidi.
|
|
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
|
-
'
|
|
22
|
-
params:
|
|
30
|
+
'bluetooth.simulateAdapter': {
|
|
31
|
+
params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
|
|
23
32
|
returnType: Bidi.EmptyResult;
|
|
24
33
|
};
|
|
25
|
-
'
|
|
26
|
-
params:
|
|
27
|
-
returnType: Bidi.
|
|
34
|
+
'bluetooth.simulateAdvertisement': {
|
|
35
|
+
params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
|
|
36
|
+
returnType: Bidi.EmptyResult;
|
|
28
37
|
};
|
|
29
|
-
'
|
|
30
|
-
params:
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriver-bidi-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
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": "^
|
|
24
|
-
"gts": "^
|
|
23
|
+
"@types/node": "^22.5.2",
|
|
24
|
+
"gts": "^6.0.2",
|
|
25
25
|
"parse5": "^7.1.2",
|
|
26
|
-
"prettier": "3.
|
|
27
|
-
"tsd": "0.31.
|
|
28
|
-
"typescript": "5.
|
|
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
|
@@ -23,14 +23,16 @@ export type CommandData =
|
|
|
23
23
|
| NetworkCommand
|
|
24
24
|
| ScriptCommand
|
|
25
25
|
| SessionCommand
|
|
26
|
-
| StorageCommand
|
|
26
|
+
| StorageCommand
|
|
27
|
+
| WebExtensionsCommand;
|
|
27
28
|
export type ResultData =
|
|
28
29
|
| BrowsingContextResult
|
|
29
30
|
| EmptyResult
|
|
30
31
|
| NetworkResult
|
|
31
32
|
| ScriptResult
|
|
32
33
|
| SessionResult
|
|
33
|
-
| StorageResult
|
|
34
|
+
| StorageResult
|
|
35
|
+
| WebExtensionsResult;
|
|
34
36
|
export type EmptyParams = Extensible;
|
|
35
37
|
export type Message = CommandResponse | ErrorResponse | Event;
|
|
36
38
|
export type ErrorResponse = {
|
|
@@ -58,6 +60,7 @@ export const enum ErrorCode {
|
|
|
58
60
|
InvalidArgument = 'invalid argument',
|
|
59
61
|
InvalidSelector = 'invalid selector',
|
|
60
62
|
InvalidSessionId = 'invalid session id',
|
|
63
|
+
InvalidWebExtension = 'invalid web extension',
|
|
61
64
|
MoveTargetOutOfBounds = 'move target out of bounds',
|
|
62
65
|
NoSuchAlert = 'no such alert',
|
|
63
66
|
NoSuchElement = 'no such element',
|
|
@@ -70,6 +73,7 @@ export const enum ErrorCode {
|
|
|
70
73
|
NoSuchScript = 'no such script',
|
|
71
74
|
NoSuchStoragePartition = 'no such storage partition',
|
|
72
75
|
NoSuchUserContext = 'no such user context',
|
|
76
|
+
NoSuchWebExtension = 'no such web extension',
|
|
73
77
|
SessionNotCreated = 'session not created',
|
|
74
78
|
UnableToCaptureScreen = 'unable to capture screen',
|
|
75
79
|
UnableToCloseBrowser = 'unable to close browser',
|
|
@@ -237,11 +241,28 @@ export namespace Session {
|
|
|
237
241
|
export type BrowserCommand =
|
|
238
242
|
| Browser.Close
|
|
239
243
|
| Browser.CreateUserContext
|
|
244
|
+
| Browser.GetClientWindows
|
|
240
245
|
| Browser.GetUserContexts
|
|
241
|
-
| Browser.RemoveUserContext
|
|
246
|
+
| Browser.RemoveUserContext
|
|
247
|
+
| Browser.SetClientWindowState
|
|
248
|
+
| Record<string, never>;
|
|
242
249
|
export type BrowserResult =
|
|
243
250
|
| Browser.CreateUserContextResult
|
|
244
251
|
| Browser.GetUserContextsResult;
|
|
252
|
+
export namespace Browser {
|
|
253
|
+
export type ClientWindow = string;
|
|
254
|
+
}
|
|
255
|
+
export namespace Browser {
|
|
256
|
+
export type ClientWindowInfo = {
|
|
257
|
+
active: boolean;
|
|
258
|
+
clientWindow: Browser.ClientWindow;
|
|
259
|
+
height: JsUint;
|
|
260
|
+
state: 'fullscreen' | 'maximized' | 'minimized' | 'normal';
|
|
261
|
+
width: JsUint;
|
|
262
|
+
x: JsInt;
|
|
263
|
+
y: JsInt;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
245
266
|
export namespace Browser {
|
|
246
267
|
export type UserContext = string;
|
|
247
268
|
}
|
|
@@ -265,6 +286,17 @@ export namespace Browser {
|
|
|
265
286
|
export namespace Browser {
|
|
266
287
|
export type CreateUserContextResult = Browser.UserContextInfo;
|
|
267
288
|
}
|
|
289
|
+
export namespace Browser {
|
|
290
|
+
export type GetClientWindows = {
|
|
291
|
+
method: 'browser.getClientWindows';
|
|
292
|
+
params: EmptyParams;
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
export namespace Browser {
|
|
296
|
+
export type GetClientWindowsResult = {
|
|
297
|
+
clientWindows: [...Browser.ClientWindowInfo[]];
|
|
298
|
+
};
|
|
299
|
+
}
|
|
268
300
|
export namespace Browser {
|
|
269
301
|
export type GetUserContexts = {
|
|
270
302
|
method: 'browser.getUserContexts';
|
|
@@ -287,6 +319,33 @@ export namespace Browser {
|
|
|
287
319
|
userContext: Browser.UserContext;
|
|
288
320
|
};
|
|
289
321
|
}
|
|
322
|
+
export namespace Browser {
|
|
323
|
+
export type SetClientWindowState = {
|
|
324
|
+
method: 'browser.setClientWindowState';
|
|
325
|
+
params: Browser.SetClientWindowStateParameters;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
export namespace Browser {
|
|
329
|
+
export type SetClientWindowStateParameters =
|
|
330
|
+
| ({
|
|
331
|
+
clientWindow: Browser.ClientWindow;
|
|
332
|
+
} & Browser.ClientWindowNamedState)
|
|
333
|
+
| Browser.ClientWindowRectState;
|
|
334
|
+
}
|
|
335
|
+
export namespace Browser {
|
|
336
|
+
export type ClientWindowNamedState = {
|
|
337
|
+
state: 'fullscreen' | 'maximized' | 'minimized';
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
export namespace Browser {
|
|
341
|
+
export type ClientWindowRectState = {
|
|
342
|
+
state: 'normal';
|
|
343
|
+
width?: JsUint;
|
|
344
|
+
height?: JsUint;
|
|
345
|
+
x?: JsInt;
|
|
346
|
+
y?: JsInt;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
290
349
|
export type BrowsingContextCommand =
|
|
291
350
|
| BrowsingContext.Activate
|
|
292
351
|
| BrowsingContext.CaptureScreenshot
|
|
@@ -306,6 +365,7 @@ export type BrowsingContextEvent =
|
|
|
306
365
|
| BrowsingContext.DomContentLoaded
|
|
307
366
|
| BrowsingContext.DownloadWillBegin
|
|
308
367
|
| BrowsingContext.FragmentNavigated
|
|
368
|
+
| BrowsingContext.HistoryUpdated
|
|
309
369
|
| BrowsingContext.Load
|
|
310
370
|
| BrowsingContext.NavigationAborted
|
|
311
371
|
| BrowsingContext.NavigationFailed
|
|
@@ -329,6 +389,7 @@ export namespace BrowsingContext {
|
|
|
329
389
|
export namespace BrowsingContext {
|
|
330
390
|
export type Info = {
|
|
331
391
|
children: BrowsingContext.InfoList | null;
|
|
392
|
+
clientWindow: Browser.ClientWindow;
|
|
332
393
|
context: BrowsingContext.BrowsingContext;
|
|
333
394
|
originalOpener: BrowsingContext.BrowsingContext | null;
|
|
334
395
|
url: string;
|
|
@@ -731,6 +792,18 @@ export namespace BrowsingContext {
|
|
|
731
792
|
params: BrowsingContext.NavigationInfo;
|
|
732
793
|
};
|
|
733
794
|
}
|
|
795
|
+
export namespace BrowsingContext {
|
|
796
|
+
export type HistoryUpdated = {
|
|
797
|
+
method: 'browsingContext.historyUpdated';
|
|
798
|
+
params: BrowsingContext.HistoryUpdatedParameters;
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
export namespace BrowsingContext {
|
|
802
|
+
export type HistoryUpdatedParameters = {
|
|
803
|
+
context: BrowsingContext.BrowsingContext;
|
|
804
|
+
url: string;
|
|
805
|
+
};
|
|
806
|
+
}
|
|
734
807
|
export namespace BrowsingContext {
|
|
735
808
|
export type DomContentLoaded = {
|
|
736
809
|
method: 'browsingContext.domContentLoaded';
|
|
@@ -896,11 +969,11 @@ export namespace Network {
|
|
|
896
969
|
}
|
|
897
970
|
export namespace Network {
|
|
898
971
|
export type Initiator = {
|
|
899
|
-
type: 'parser' | 'script' | 'preflight' | 'other';
|
|
900
972
|
columnNumber?: JsUint;
|
|
901
973
|
lineNumber?: JsUint;
|
|
902
|
-
stackTrace?: Script.StackTrace;
|
|
903
974
|
request?: Network.Request;
|
|
975
|
+
stackTrace?: Script.StackTrace;
|
|
976
|
+
type?: 'parser' | 'script' | 'preflight' | 'other';
|
|
904
977
|
};
|
|
905
978
|
}
|
|
906
979
|
export namespace Network {
|
|
@@ -918,6 +991,8 @@ export namespace Network {
|
|
|
918
991
|
cookies: [...Network.Cookie[]];
|
|
919
992
|
headersSize: JsUint;
|
|
920
993
|
bodySize: JsUint | null;
|
|
994
|
+
destination: string;
|
|
995
|
+
initiatorType: string | null;
|
|
921
996
|
timings: Network.FetchTimingInfo;
|
|
922
997
|
};
|
|
923
998
|
}
|
|
@@ -1123,7 +1198,7 @@ export namespace Network {
|
|
|
1123
1198
|
}
|
|
1124
1199
|
export namespace Network {
|
|
1125
1200
|
export type BeforeRequestSentParameters = Network.BaseParameters & {
|
|
1126
|
-
initiator
|
|
1201
|
+
initiator?: Network.Initiator;
|
|
1127
1202
|
};
|
|
1128
1203
|
}
|
|
1129
1204
|
export namespace Network {
|
|
@@ -2189,3 +2264,61 @@ export namespace Input {
|
|
|
2189
2264
|
files: [...string[]];
|
|
2190
2265
|
};
|
|
2191
2266
|
}
|
|
2267
|
+
export type WebExtensionsCommand =
|
|
2268
|
+
| WebExtension.Install
|
|
2269
|
+
| WebExtension.Uninstall;
|
|
2270
|
+
export type WebExtensionsResult = WebExtension.InstallResult;
|
|
2271
|
+
export namespace WebExtension {
|
|
2272
|
+
export type Extension = string;
|
|
2273
|
+
}
|
|
2274
|
+
export namespace WebExtension {
|
|
2275
|
+
export type InstallParameters = {
|
|
2276
|
+
extensionData: WebExtension.ExtensionData;
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
export namespace WebExtension {
|
|
2280
|
+
export type Install = {
|
|
2281
|
+
method: 'webExtension.install';
|
|
2282
|
+
params: WebExtension.InstallParameters;
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
export namespace WebExtension {
|
|
2286
|
+
export type ExtensionData =
|
|
2287
|
+
| WebExtension.ExtensionArchivePath
|
|
2288
|
+
| WebExtension.ExtensionBase64Encoded
|
|
2289
|
+
| WebExtension.ExtensionPath;
|
|
2290
|
+
}
|
|
2291
|
+
export namespace WebExtension {
|
|
2292
|
+
export type ExtensionPath = {
|
|
2293
|
+
type: 'path';
|
|
2294
|
+
path: string;
|
|
2295
|
+
};
|
|
2296
|
+
}
|
|
2297
|
+
export namespace WebExtension {
|
|
2298
|
+
export type ExtensionArchivePath = {
|
|
2299
|
+
type: 'archivePath';
|
|
2300
|
+
path: string;
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
export namespace WebExtension {
|
|
2304
|
+
export type ExtensionBase64Encoded = {
|
|
2305
|
+
type: 'base64';
|
|
2306
|
+
value: string;
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
export namespace WebExtension {
|
|
2310
|
+
export type InstallResult = {
|
|
2311
|
+
extension: WebExtension.Extension;
|
|
2312
|
+
};
|
|
2313
|
+
}
|
|
2314
|
+
export namespace WebExtension {
|
|
2315
|
+
export type Uninstall = {
|
|
2316
|
+
method: 'webExtension.uninstall';
|
|
2317
|
+
params: WebExtension.UninstallParameters;
|
|
2318
|
+
};
|
|
2319
|
+
}
|
|
2320
|
+
export namespace WebExtension {
|
|
2321
|
+
export type UninstallParameters = {
|
|
2322
|
+
extension: WebExtension.Extension;
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
@@ -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 =
|
|
14
|
-
|
|
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
|
-
'
|
|
19
|
-
params:
|
|
20
|
-
returnType: Bidi.
|
|
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
|
-
'
|
|
27
|
-
params:
|
|
35
|
+
'bluetooth.simulateAdapter': {
|
|
36
|
+
params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
|
|
28
37
|
returnType: Bidi.EmptyResult;
|
|
29
38
|
};
|
|
30
|
-
'
|
|
31
|
-
params:
|
|
32
|
-
returnType: Bidi.
|
|
39
|
+
'bluetooth.simulateAdvertisement': {
|
|
40
|
+
params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
|
|
41
|
+
returnType: Bidi.EmptyResult;
|
|
33
42
|
};
|
|
34
|
-
'
|
|
35
|
-
params:
|
|
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
|
|