chromium-bidi 0.4.19 → 0.4.21
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/.browser +1 -1
- package/README.md +19 -2
- package/lib/cjs/bidiMapper/BidiNoOpParser.d.ts +8 -1
- package/lib/cjs/bidiMapper/BidiNoOpParser.js +24 -0
- package/lib/cjs/bidiMapper/BidiNoOpParser.js.map +1 -1
- package/lib/cjs/bidiMapper/BidiParser.d.ts +8 -1
- package/lib/cjs/bidiMapper/BidiServer.d.ts +2 -1
- package/lib/cjs/bidiMapper/BidiServer.js +5 -5
- package/lib/cjs/bidiMapper/BidiServer.js.map +1 -1
- package/lib/cjs/bidiMapper/CommandProcessor.d.ts +12 -5
- package/lib/cjs/bidiMapper/CommandProcessor.js +51 -9
- package/lib/cjs/bidiMapper/CommandProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/OutgoingBidiMessage.d.ts +3 -2
- package/lib/cjs/bidiMapper/OutgoingBidiMessage.js +15 -4
- package/lib/cjs/bidiMapper/OutgoingBidiMessage.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/browser/BrowserProcessor.d.ts +23 -0
- package/lib/cjs/bidiMapper/domains/browser/BrowserProcessor.js +34 -0
- package/lib/cjs/bidiMapper/domains/browser/BrowserProcessor.js.map +1 -0
- package/lib/cjs/bidiMapper/domains/context/browsingContextImpl.d.ts +5 -3
- package/lib/cjs/bidiMapper/domains/context/browsingContextImpl.js +6 -13
- package/lib/cjs/bidiMapper/domains/context/browsingContextImpl.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/context/browsingContextProcessor.d.ts +3 -2
- package/lib/cjs/bidiMapper/domains/context/browsingContextProcessor.js +6 -4
- package/lib/cjs/bidiMapper/domains/context/browsingContextProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/context/cdpTarget.d.ts +20 -6
- package/lib/cjs/bidiMapper/domains/context/cdpTarget.js +32 -9
- package/lib/cjs/bidiMapper/domains/context/cdpTarget.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/events/EventManager.d.ts +3 -8
- package/lib/cjs/bidiMapper/domains/events/EventManager.js +7 -3
- package/lib/cjs/bidiMapper/domains/events/EventManager.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/events/SubscriptionManager.js +17 -26
- package/lib/cjs/bidiMapper/domains/events/SubscriptionManager.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/input/InputProcessor.d.ts +1 -2
- package/lib/cjs/bidiMapper/domains/input/InputProcessor.js +0 -3
- package/lib/cjs/bidiMapper/domains/input/InputProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/log/logManager.d.ts +2 -2
- package/lib/cjs/bidiMapper/domains/log/logManager.js +31 -25
- package/lib/cjs/bidiMapper/domains/log/logManager.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/network/NetworkManager.d.ts +6 -4
- package/lib/cjs/bidiMapper/domains/network/NetworkManager.js +38 -43
- package/lib/cjs/bidiMapper/domains/network/NetworkManager.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/network/NetworkProcessor.d.ts +33 -0
- package/lib/cjs/bidiMapper/domains/network/NetworkProcessor.js +74 -0
- package/lib/cjs/bidiMapper/domains/network/NetworkProcessor.js.map +1 -0
- package/lib/cjs/bidiMapper/domains/network/{networkRequest.d.ts → NetworkRequest.d.ts} +3 -2
- package/lib/cjs/bidiMapper/domains/network/{networkRequest.js → NetworkRequest.js} +82 -27
- package/lib/cjs/bidiMapper/domains/network/NetworkRequest.js.map +1 -0
- package/lib/cjs/bidiMapper/domains/network/NetworkStorage.d.ts +58 -0
- package/lib/cjs/bidiMapper/domains/network/NetworkStorage.js +134 -0
- package/lib/cjs/bidiMapper/domains/network/NetworkStorage.js.map +1 -0
- package/lib/cjs/bidiMapper/domains/script/ScriptProcessor.d.ts +2 -1
- package/lib/cjs/bidiMapper/domains/script/ScriptProcessor.js +6 -4
- package/lib/cjs/bidiMapper/domains/script/ScriptProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/script/bidiPreloadScript.d.ts +5 -3
- package/lib/cjs/bidiMapper/domains/script/bidiPreloadScript.js +2 -2
- package/lib/cjs/bidiMapper/domains/script/bidiPreloadScript.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/script/channelProxy.d.ts +5 -4
- package/lib/cjs/bidiMapper/domains/script/channelProxy.js +45 -38
- package/lib/cjs/bidiMapper/domains/script/channelProxy.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/script/realm.d.ts +4 -4
- package/lib/cjs/bidiMapper/domains/script/realm.js +6 -4
- package/lib/cjs/bidiMapper/domains/script/realm.js.map +1 -1
- package/lib/cjs/bidiMapper/domains/script/realmStorage.d.ts +1 -1
- package/lib/cjs/bidiMapper/domains/session/SessionProcessor.d.ts +4 -4
- package/lib/cjs/bidiMapper/domains/session/SessionProcessor.js +4 -4
- package/lib/cjs/bidiMapper/domains/session/SessionProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/bidiServer/bidiServerRunner.d.ts +1 -1
- package/lib/cjs/bidiServer/bidiServerRunner.js +24 -12
- package/lib/cjs/bidiServer/bidiServerRunner.js.map +1 -1
- package/lib/cjs/bidiServer/index.js +6 -3
- package/lib/cjs/bidiServer/index.js.map +1 -1
- package/lib/cjs/bidiServer/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/bidiTab/BidiParserImpl.d.ts +8 -1
- package/lib/cjs/bidiTab/BidiParserImpl.js +24 -0
- package/lib/cjs/bidiTab/BidiParserImpl.js.map +1 -1
- package/lib/cjs/bidiTab/bidiTab.js +5 -3
- package/lib/cjs/bidiTab/bidiTab.js.map +1 -1
- package/lib/cjs/bidiTab/mapperTabPage.js +1 -2
- package/lib/cjs/bidiTab/mapperTabPage.js.map +1 -1
- package/lib/cjs/bidiTab/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/cdp/cdpClient.d.ts +5 -6
- package/lib/cjs/cdp/cdpClient.js.map +1 -1
- package/lib/cjs/cdp/cdpConnection.d.ts +7 -4
- package/lib/cjs/cdp/cdpConnection.js +5 -3
- package/lib/cjs/cdp/cdpConnection.js.map +1 -1
- package/lib/cjs/cdp/cdpMessage.d.ts +2 -1
- package/lib/cjs/cdp/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/protocol/ErrorResponse.d.ts +18 -6
- package/lib/cjs/protocol/ErrorResponse.js +41 -33
- package/lib/cjs/protocol/ErrorResponse.js.map +1 -1
- package/lib/cjs/protocol/cdp.d.ts +5 -4
- package/lib/cjs/protocol/chromium-bidi.d.ts +10 -6
- package/lib/cjs/protocol/chromium-bidi.js +10 -5
- package/lib/cjs/protocol/chromium-bidi.js.map +1 -1
- package/lib/cjs/protocol/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/protocol/webdriver-bidi.d.ts +258 -44
- package/lib/cjs/protocol-parser/protocol-parser.d.ts +145 -2
- package/lib/cjs/protocol-parser/protocol-parser.js +33 -1
- package/lib/cjs/protocol-parser/protocol-parser.js.map +1 -1
- package/lib/cjs/protocol-parser/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/protocol-parser/webdriver-bidi.d.ts +19567 -9508
- package/lib/cjs/protocol-parser/webdriver-bidi.js +202 -4
- package/lib/cjs/protocol-parser/webdriver-bidi.js.map +1 -1
- package/lib/cjs/utils/assert.js +2 -2
- package/lib/cjs/utils/assert.js.map +1 -1
- package/lib/cjs/utils/deferred.js +2 -2
- package/lib/cjs/utils/deferred.js.map +1 -1
- package/lib/cjs/utils/log.d.ts +4 -4
- package/lib/cjs/utils/log.js +4 -4
- package/lib/cjs/utils/log.js.map +1 -1
- package/lib/cjs/utils/processingQueue.d.ts +3 -1
- package/lib/cjs/utils/processingQueue.js +18 -6
- package/lib/cjs/utils/processingQueue.js.map +1 -1
- package/lib/cjs/utils/result.d.ts +23 -0
- package/lib/cjs/utils/result.js +19 -0
- package/lib/cjs/utils/result.js.map +1 -0
- package/lib/cjs/utils/tsconfig.tsbuildinfo +1 -1
- package/lib/iife/mapperTab.js +2 -2
- package/lib/iife/mapperTab.js.map +1 -1
- package/package.json +19 -18
- package/lib/cjs/bidiMapper/domains/network/networkRequest.js.map +0 -1
package/.browser
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
chrome@
|
|
1
|
+
chrome@118.0.5961.0
|
package/README.md
CHANGED
|
@@ -144,10 +144,10 @@ npm install
|
|
|
144
144
|
|
|
145
145
|
<!-- TODO(jrandolf): Remove after binaries get published -->
|
|
146
146
|
|
|
147
|
-
We use [cddlconv](https://github.com/
|
|
147
|
+
We use [cddlconv](https://github.com/google/cddlconv) to generate our WebDriverBidi types before building.
|
|
148
148
|
|
|
149
149
|
1. Install [Rust](https://rustup.rs/).
|
|
150
|
-
2. Run `cargo install --git https://github.com/
|
|
150
|
+
2. Run `cargo install --git https://github.com/google/cddlconv.git cddlconv`
|
|
151
151
|
|
|
152
152
|
### pre-commit.com integration
|
|
153
153
|
|
|
@@ -399,3 +399,20 @@ We use [release-please](https://github.com/googleapis/release-please) to automat
|
|
|
399
399
|
|
|
400
400
|
1. After the PR is reviewed, [create a GitHub release](https://github.com/GoogleChromeLabs/chromium-bidi/releases/new) specifying the tag name matching the bumped version.
|
|
401
401
|
Our CI then automatically publishes the new release to npm based on the tag name.
|
|
402
|
+
|
|
403
|
+
#### Roll into Chromium
|
|
404
|
+
|
|
405
|
+
> Assuming that you already have a Chromium set-up locally, and knowledge on how to submit changes to the repo.
|
|
406
|
+
> Else submit an issue for a project maintainer to do.
|
|
407
|
+
|
|
408
|
+
1. Create a new branch.
|
|
409
|
+
2. Navigate to `third_party/bidimapper/`.
|
|
410
|
+
3. Then run the following commands:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
./pull.sh
|
|
414
|
+
./build.sh
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
4. Submit a CL with bug `chromedriver:4226`
|
|
418
|
+
5. Add appropriate reviewers or comment the CL link on the PR
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type { BrowsingContext, Cdp, Input, Script, Session } from '../protocol/protocol.js';
|
|
17
|
+
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
|
|
18
18
|
import type { IBidiParser } from './BidiParser.js';
|
|
19
19
|
export declare class BidiNoOpParser implements IBidiParser {
|
|
20
20
|
parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;
|
|
@@ -37,5 +37,12 @@ export declare class BidiNoOpParser implements IBidiParser {
|
|
|
37
37
|
parseRemovePreloadScriptParams(params: unknown): Script.RemovePreloadScriptParameters;
|
|
38
38
|
parsePerformActionsParams(params: unknown): Input.PerformActionsParameters;
|
|
39
39
|
parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
|
|
40
|
+
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;
|
|
41
|
+
parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;
|
|
42
|
+
parseContinueResponseParams(params: unknown): Network.ContinueResponseParameters;
|
|
43
|
+
parseContinueWithAuthParams(params: unknown): Network.ContinueWithAuthParameters;
|
|
44
|
+
parseFailRequestParams(params: unknown): Network.FailRequestParameters;
|
|
45
|
+
parseProvideResponseParams(params: unknown): Network.ProvideResponseParameters;
|
|
46
|
+
parseRemoveInterceptParams(params: unknown): Network.RemoveInterceptParameters;
|
|
40
47
|
parseSubscribeParams(params: unknown): Session.SubscriptionRequest;
|
|
41
48
|
}
|
|
@@ -90,6 +90,30 @@ class BidiNoOpParser {
|
|
|
90
90
|
return params;
|
|
91
91
|
}
|
|
92
92
|
// keep-sorted end
|
|
93
|
+
// Network domain
|
|
94
|
+
// keep-sorted start block=yes
|
|
95
|
+
parseAddInterceptParams(params) {
|
|
96
|
+
return params;
|
|
97
|
+
}
|
|
98
|
+
parseContinueRequestParams(params) {
|
|
99
|
+
return params;
|
|
100
|
+
}
|
|
101
|
+
parseContinueResponseParams(params) {
|
|
102
|
+
return params;
|
|
103
|
+
}
|
|
104
|
+
parseContinueWithAuthParams(params) {
|
|
105
|
+
return params;
|
|
106
|
+
}
|
|
107
|
+
parseFailRequestParams(params) {
|
|
108
|
+
return params;
|
|
109
|
+
}
|
|
110
|
+
parseProvideResponseParams(params) {
|
|
111
|
+
return params;
|
|
112
|
+
}
|
|
113
|
+
parseRemoveInterceptParams(params) {
|
|
114
|
+
return params;
|
|
115
|
+
}
|
|
116
|
+
// keep-sorted end
|
|
93
117
|
// Session domain
|
|
94
118
|
// keep-sorted start block=yes
|
|
95
119
|
parseSubscribeParams(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BidiNoOpParser.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiNoOpParser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;
|
|
1
|
+
{"version":3,"file":"BidiNoOpParser.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiNoOpParser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAaH,MAAa,cAAc;IACzB,0BAA0B;IAC1B,8BAA8B;IAC9B,mBAAmB,CAAC,MAAe;QACjC,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,4BAA4B,CAC1B,MAAe;QAEf,OAAO,MAAqD,CAAC;IAC/D,CAAC;IACD,gBAAgB,CAAC,MAAe;QAC9B,OAAO,MAAyC,CAAC;IACnD,CAAC;IACD,iBAAiB,CAAC,MAAe;QAC/B,OAAO,MAA0C,CAAC;IACpD,CAAC;IACD,kBAAkB,CAAC,MAAe;QAChC,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,2BAA2B,CACzB,MAAe;QAEf,OAAO,MAAoD,CAAC;IAC9D,CAAC;IACD,mBAAmB,CAAC,MAAe;QACjC,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,gBAAgB,CAAC,MAAe;QAC9B,OAAO,MAAyC,C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AO,MAAuC,CAAC;IACjD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,kBAAkB;IAElB,iBAAiB;IACjB,8BAA8B;IAC9B,oBAAoB,CAAC,MAAe;QAClC,OAAO,MAAqC,CAAC;IAC/C,CAAC;CAEF;AAhID,wCAgIC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type { BrowsingContext, Cdp, Input, Script, Session } from '../protocol/protocol.js';
|
|
17
|
+
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
|
|
18
18
|
export interface IBidiParser {
|
|
19
19
|
parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;
|
|
20
20
|
parseCaptureScreenshotParams(params: unknown): BrowsingContext.CaptureScreenshotParameters;
|
|
@@ -30,6 +30,13 @@ export interface IBidiParser {
|
|
|
30
30
|
parseSendCommandParams(params: unknown): Cdp.SendCommandParameters;
|
|
31
31
|
parsePerformActionsParams(params: unknown): Input.PerformActionsParameters;
|
|
32
32
|
parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
|
|
33
|
+
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;
|
|
34
|
+
parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;
|
|
35
|
+
parseContinueResponseParams(params: unknown): Network.ContinueResponseParameters;
|
|
36
|
+
parseContinueWithAuthParams(params: unknown): Network.ContinueWithAuthParameters;
|
|
37
|
+
parseFailRequestParams(params: unknown): Network.FailRequestParameters;
|
|
38
|
+
parseProvideResponseParams(params: unknown): Network.ProvideResponseParameters;
|
|
39
|
+
parseRemoveInterceptParams(params: unknown): Network.RemoveInterceptParameters;
|
|
33
40
|
parseAddPreloadScriptParams(params: unknown): Script.AddPreloadScriptParameters;
|
|
34
41
|
parseCallFunctionParams(params: unknown): Script.CallFunctionParameters;
|
|
35
42
|
parseDisownParams(params: unknown): Script.DisownParameters;
|
|
@@ -18,6 +18,7 @@ import type { ICdpConnection } from '../cdp/cdpConnection.js';
|
|
|
18
18
|
import type { ChromiumBidi } from '../protocol/protocol.js';
|
|
19
19
|
import { EventEmitter } from '../utils/EventEmitter.js';
|
|
20
20
|
import { type LoggerFn } from '../utils/log.js';
|
|
21
|
+
import type { Result } from '../utils/result.js';
|
|
21
22
|
import type { IBidiParser } from './BidiParser.js';
|
|
22
23
|
import type { IBidiTransport } from './BidiTransport.js';
|
|
23
24
|
import type { OutgoingBidiMessage } from './OutgoingBidiMessage.js';
|
|
@@ -32,7 +33,7 @@ export declare class BidiServer extends EventEmitter<BidiServerEvent> {
|
|
|
32
33
|
/**
|
|
33
34
|
* Sends BiDi message.
|
|
34
35
|
*/
|
|
35
|
-
emitOutgoingMessage(messageEntry: Promise<OutgoingBidiMessage
|
|
36
|
+
emitOutgoingMessage(messageEntry: Promise<Result<OutgoingBidiMessage>>, event: string): void;
|
|
36
37
|
close(): void;
|
|
37
38
|
getBrowsingContextStorage(): BrowsingContextStorage;
|
|
38
39
|
}
|
|
@@ -32,7 +32,7 @@ class BidiServer extends EventEmitter_js_1.EventEmitter {
|
|
|
32
32
|
#logger;
|
|
33
33
|
#handleIncomingMessage = (message) => {
|
|
34
34
|
void this.#commandProcessor.processCommand(message).catch((error) => {
|
|
35
|
-
this.#logger?.(log_js_1.LogType.
|
|
35
|
+
this.#logger?.(log_js_1.LogType.debug, error);
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
#processOutgoingMessage = async (messageEntry) => {
|
|
@@ -49,8 +49,8 @@ class BidiServer extends EventEmitter_js_1.EventEmitter {
|
|
|
49
49
|
this.#transport = bidiTransport;
|
|
50
50
|
this.#transport.setOnMessage(this.#handleIncomingMessage);
|
|
51
51
|
this.#commandProcessor = new CommandProcessor_js_1.CommandProcessor(cdpConnection, new EventManager_js_1.EventManager(this), selfTargetId, this.#browsingContextStorage, new realmStorage_js_1.RealmStorage(), parser, this.#logger);
|
|
52
|
-
this.#commandProcessor.on(
|
|
53
|
-
this.emitOutgoingMessage(
|
|
52
|
+
this.#commandProcessor.on("response" /* CommandProcessorEvents.Response */, ({ message, event }) => {
|
|
53
|
+
this.emitOutgoingMessage(message, event);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
static async createAndStart(bidiTransport, cdpConnection, selfTargetId, parser, logger) {
|
|
@@ -70,8 +70,8 @@ class BidiServer extends EventEmitter_js_1.EventEmitter {
|
|
|
70
70
|
/**
|
|
71
71
|
* Sends BiDi message.
|
|
72
72
|
*/
|
|
73
|
-
emitOutgoingMessage(messageEntry) {
|
|
74
|
-
this.#messageQueue.add(messageEntry);
|
|
73
|
+
emitOutgoingMessage(messageEntry, event) {
|
|
74
|
+
this.#messageQueue.add(messageEntry, event);
|
|
75
75
|
}
|
|
76
76
|
close() {
|
|
77
77
|
this.#transport.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BidiServer.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiServer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAIH,8DAAsD;AACtD,4CAAuD;AACvD,oEAA4D;
|
|
1
|
+
{"version":3,"file":"BidiServer.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiServer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAIH,8DAAsD;AACtD,4CAAuD;AACvD,oEAA4D;AAK5D,+DAA+E;AAE/E,2FAAmF;AACnF,sEAA8D;AAC9D,sEAA8D;AAM9D,MAAa,UAAW,SAAQ,8BAA6B;IAC3D,aAAa,CAAuC;IACpD,UAAU,CAAiB;IAC3B,iBAAiB,CAAmB;IACpC,uBAAuB,GAAG,IAAI,kDAAsB,EAAE,CAAC;IACvD,OAAO,CAAY;IAEnB,sBAAsB,G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from '../cdp/cdpConnection.js';
|
|
|
18
18
|
import { type ChromiumBidi } from '../protocol/protocol.js';
|
|
19
19
|
import { EventEmitter } from '../utils/EventEmitter.js';
|
|
20
20
|
import { type LoggerFn } from '../utils/log.js';
|
|
21
|
+
import type { Result } from '../utils/result.js';
|
|
21
22
|
import type { IBidiParser } from './BidiParser.js';
|
|
22
23
|
import { OutgoingBidiMessage } from './OutgoingBidiMessage.js';
|
|
23
24
|
import type { BrowsingContextStorage } from './domains/context/browsingContextStorage.js';
|
|
24
|
-
import type {
|
|
25
|
+
import type { EventManager } from './domains/events/EventManager.js';
|
|
25
26
|
import type { RealmStorage } from './domains/script/realmStorage.js';
|
|
26
|
-
|
|
27
|
-
response
|
|
27
|
+
export declare const enum CommandProcessorEvents {
|
|
28
|
+
Response = "response"
|
|
29
|
+
}
|
|
30
|
+
type CommandProcessorEventsMap = {
|
|
31
|
+
[CommandProcessorEvents.Response]: {
|
|
32
|
+
message: Promise<Result<OutgoingBidiMessage>>;
|
|
33
|
+
event: string;
|
|
34
|
+
};
|
|
28
35
|
};
|
|
29
|
-
export declare class CommandProcessor extends EventEmitter<
|
|
36
|
+
export declare class CommandProcessor extends EventEmitter<CommandProcessorEventsMap> {
|
|
30
37
|
#private;
|
|
31
|
-
constructor(cdpConnection: ICdpConnection, eventManager:
|
|
38
|
+
constructor(cdpConnection: ICdpConnection, eventManager: EventManager, selfTargetId: string, browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage, parser?: IBidiParser, logger?: LoggerFn);
|
|
32
39
|
processCommand(command: ChromiumBidi.Command): Promise<void>;
|
|
33
40
|
}
|
|
34
41
|
export {};
|
|
@@ -22,38 +22,54 @@ const EventEmitter_js_1 = require("../utils/EventEmitter.js");
|
|
|
22
22
|
const log_js_1 = require("../utils/log.js");
|
|
23
23
|
const BidiNoOpParser_js_1 = require("./BidiNoOpParser.js");
|
|
24
24
|
const OutgoingBidiMessage_js_1 = require("./OutgoingBidiMessage.js");
|
|
25
|
+
const BrowserProcessor_js_1 = require("./domains/browser/BrowserProcessor.js");
|
|
25
26
|
const CdpProcessor_js_1 = require("./domains/cdp/CdpProcessor.js");
|
|
26
27
|
const browsingContextProcessor_js_1 = require("./domains/context/browsingContextProcessor.js");
|
|
27
28
|
const InputProcessor_js_1 = require("./domains/input/InputProcessor.js");
|
|
28
29
|
const PreloadScriptStorage_js_1 = require("./domains/script/PreloadScriptStorage.js");
|
|
29
30
|
const ScriptProcessor_js_1 = require("./domains/script/ScriptProcessor.js");
|
|
31
|
+
const NetworkProcessor_js_1 = require("./domains/network/NetworkProcessor.js");
|
|
30
32
|
const SessionProcessor_js_1 = require("./domains/session/SessionProcessor.js");
|
|
33
|
+
const NetworkStorage_js_1 = require("./domains/network/NetworkStorage.js");
|
|
31
34
|
class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
|
35
|
+
// keep-sorted start
|
|
36
|
+
#browserProcessor;
|
|
32
37
|
#browsingContextProcessor;
|
|
38
|
+
#cdpProcessor;
|
|
33
39
|
#inputProcessor;
|
|
40
|
+
#networkProcessor;
|
|
34
41
|
#scriptProcessor;
|
|
35
42
|
#sessionProcessor;
|
|
36
|
-
|
|
43
|
+
// keep-sorted end
|
|
37
44
|
#parser;
|
|
38
45
|
#logger;
|
|
39
46
|
constructor(cdpConnection, eventManager, selfTargetId, browsingContextStorage, realmStorage, parser = new BidiNoOpParser_js_1.BidiNoOpParser(), logger) {
|
|
40
47
|
super();
|
|
41
48
|
this.#parser = parser;
|
|
42
49
|
this.#logger = logger;
|
|
50
|
+
const networkStorage = new NetworkStorage_js_1.NetworkStorage(eventManager);
|
|
43
51
|
const preloadScriptStorage = new PreloadScriptStorage_js_1.PreloadScriptStorage();
|
|
44
|
-
|
|
45
|
-
this.#
|
|
46
|
-
this.#
|
|
47
|
-
this.#sessionProcessor = new SessionProcessor_js_1.SessionProcessor(eventManager);
|
|
52
|
+
// keep-sorted start block=yes
|
|
53
|
+
this.#browserProcessor = new BrowserProcessor_js_1.BrowserProcessor(cdpConnection);
|
|
54
|
+
this.#browsingContextProcessor = new browsingContextProcessor_js_1.BrowsingContextProcessor(cdpConnection, selfTargetId, eventManager, browsingContextStorage, realmStorage, networkStorage, preloadScriptStorage, logger);
|
|
48
55
|
this.#cdpProcessor = new CdpProcessor_js_1.CdpProcessor(browsingContextStorage, cdpConnection);
|
|
56
|
+
this.#inputProcessor = new InputProcessor_js_1.InputProcessor(browsingContextStorage);
|
|
57
|
+
this.#networkProcessor = new NetworkProcessor_js_1.NetworkProcessor(browsingContextStorage, networkStorage);
|
|
58
|
+
this.#scriptProcessor = new ScriptProcessor_js_1.ScriptProcessor(browsingContextStorage, realmStorage, preloadScriptStorage, logger);
|
|
59
|
+
this.#sessionProcessor = new SessionProcessor_js_1.SessionProcessor(eventManager);
|
|
60
|
+
// keep-sorted end
|
|
49
61
|
}
|
|
50
62
|
async #processCommand(command) {
|
|
51
63
|
switch (command.method) {
|
|
52
|
-
case 'browser.close':
|
|
53
64
|
case 'session.end':
|
|
54
65
|
case 'session.new':
|
|
55
66
|
// TODO: Implement.
|
|
56
67
|
break;
|
|
68
|
+
// Browser domain
|
|
69
|
+
// keep-sorted start block=yes
|
|
70
|
+
case 'browser.close':
|
|
71
|
+
return this.#browserProcessor.close();
|
|
72
|
+
// keep-sorted end
|
|
57
73
|
// Browsing Context domain
|
|
58
74
|
// keep-sorted start block=yes
|
|
59
75
|
case 'browsingContext.activate':
|
|
@@ -91,6 +107,23 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
|
|
91
107
|
case 'input.releaseActions':
|
|
92
108
|
return this.#inputProcessor.releaseActions(this.#parser.parseReleaseActionsParams(command.params));
|
|
93
109
|
// keep-sorted end
|
|
110
|
+
// Network domain
|
|
111
|
+
// keep-sorted start block=yes
|
|
112
|
+
case 'network.addIntercept':
|
|
113
|
+
return this.#networkProcessor.addIntercept(this.#parser.parseAddInterceptParams(command.params));
|
|
114
|
+
case 'network.continueRequest':
|
|
115
|
+
return this.#networkProcessor.continueRequest(this.#parser.parseContinueRequestParams(command.params));
|
|
116
|
+
case 'network.continueResponse':
|
|
117
|
+
return this.#networkProcessor.continueResponse(this.#parser.parseContinueResponseParams(command.params));
|
|
118
|
+
case 'network.continueWithAuth':
|
|
119
|
+
return this.#networkProcessor.continueWithAuth(this.#parser.parseContinueWithAuthParams(command.params));
|
|
120
|
+
case 'network.failRequest':
|
|
121
|
+
return this.#networkProcessor.failRequest(this.#parser.parseFailRequestParams(command.params));
|
|
122
|
+
case 'network.provideResponse':
|
|
123
|
+
return this.#networkProcessor.provideResponse(this.#parser.parseProvideResponseParams(command.params));
|
|
124
|
+
case 'network.removeIntercept':
|
|
125
|
+
return this.#networkProcessor.removeIntercept(this.#parser.parseRemoveInterceptParams(command.params));
|
|
126
|
+
// keep-sorted end
|
|
94
127
|
// Script domain
|
|
95
128
|
// keep-sorted start block=yes
|
|
96
129
|
case 'script.addPreloadScript':
|
|
@@ -129,17 +162,26 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
|
|
129
162
|
id: command.id,
|
|
130
163
|
result,
|
|
131
164
|
};
|
|
132
|
-
this.emit(
|
|
165
|
+
this.emit("response" /* CommandProcessorEvents.Response */, {
|
|
166
|
+
message: OutgoingBidiMessage_js_1.OutgoingBidiMessage.createResolved(response, command.channel),
|
|
167
|
+
event: command.method,
|
|
168
|
+
});
|
|
133
169
|
}
|
|
134
170
|
catch (e) {
|
|
135
171
|
if (e instanceof protocol_js_1.Exception) {
|
|
136
172
|
const errorResponse = e;
|
|
137
|
-
this.emit(
|
|
173
|
+
this.emit("response" /* CommandProcessorEvents.Response */, {
|
|
174
|
+
message: OutgoingBidiMessage_js_1.OutgoingBidiMessage.createResolved(errorResponse.toErrorResponse(command.id), command.channel),
|
|
175
|
+
event: command.method,
|
|
176
|
+
});
|
|
138
177
|
}
|
|
139
178
|
else {
|
|
140
179
|
const error = e;
|
|
141
180
|
this.#logger?.(log_js_1.LogType.bidi, error);
|
|
142
|
-
this.emit(
|
|
181
|
+
this.emit("response" /* CommandProcessorEvents.Response */, {
|
|
182
|
+
message: OutgoingBidiMessage_js_1.OutgoingBidiMessage.createResolved(new protocol_js_1.UnknownErrorException(error.message, error.stack).toErrorResponse(command.id), command.channel),
|
|
183
|
+
event: command.method,
|
|
184
|
+
});
|
|
143
185
|
}
|
|
144
186
|
}
|
|
145
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandProcessor.js","sourceRoot":"","sources":["../../../src/bidiMapper/CommandProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAGH,yDAKiC;AACjC,8DAAsD;AACtD,4CAAuD;
|
|
1
|
+
{"version":3,"file":"CommandProcessor.js","sourceRoot":"","sources":["../../../src/bidiMapper/CommandProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAGH,yDAKiC;AACjC,8DAAsD;AACtD,4CAAuD;AAGvD,2DAAmD;AAEnD,qEAA6D;AAC7D,+EAAuE;AACvE,mEAA2D;AAC3D,+FAAuF;AAGvF,yEAAiE;AACjE,sFAA8E;AAC9E,4EAAoE;AAEpE,+EAAuE;AACvE,+EAAuE;AACvE,2EAAmE;AAanE,MAAa,gBAAiB,SAAQ,8BAAuC;IAC3E,oBAAoB;IACpB,iBAAiB,CAAmB;IACpC,yBAAyB,CAA2B;IACpD,aAAa,CAAe;IAC5B,eAAe,CAAiB;IAChC,iBAAiB,CAAmB;IACpC,gBAAgB,CAAkB;IAClC,iBAAiB,CAAmB;IACpC,kBAAkB;IAElB,OAAO,CAAc;IACrB,OAAO,CAAY;IAEnB,YACE,aAA6B,EAC7B,YAA0B,EAC1B,YAAoB,EACpB,sBAA8C,EAC9C,YAA0B,EAC1B,SAAsB,IAAI,kCAAc,EAAE,EAC1C,MAAiB;QAEjB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,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AkC;gBACzC,OAAO,EAAE,4CAAmB,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC;gBACtE,KAAK,EAAE,OAAO,CAAC,MAAM;aACtB,CAAC,CAAC;SACJ;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,uBAAS,EAAE;gBAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;gBACxB,IAAI,CAAC,IAAI,mDAAkC;oBACzC,OAAO,EAAE,4CAAmB,CAAC,cAAc,CACzC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,EACzC,OAAO,CAAC,OAAO,CAChB;oBACD,KAAK,EAAE,OAAO,CAAC,MAAM;iBACtB,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,KAAK,GAAG,CAAU,CAAC;gBACzB,IAAI,CAAC,OAAO,EAAE,CAAC,gBAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACpC,IAAI,CAAC,IAAI,mDAAkC;oBACzC,OAAO,EAAE,4CAAmB,CAAC,cAAc,CACzC,IAAI,mCAAqB,CACvB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,EAC7B,OAAO,CAAC,OAAO,CAChB;oBACD,KAAK,EAAE,OAAO,CAAC,MAAM;iBACtB,CAAC,CAAC;aACJ;SACF;IACH,CAAC;CACF;AA3QD,4CA2QC"}
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import type { ChromiumBidi } from '../protocol/protocol.js';
|
|
18
|
+
import type { Result } from '../utils/result.js';
|
|
18
19
|
export declare class OutgoingBidiMessage {
|
|
19
20
|
#private;
|
|
20
21
|
private constructor();
|
|
21
|
-
static createFromPromise(messagePromise: Promise<ChromiumBidi.Message
|
|
22
|
-
static createResolved(message: ChromiumBidi.Message, channel
|
|
22
|
+
static createFromPromise(messagePromise: Promise<Result<ChromiumBidi.Message>>, channel: string | null): Promise<Result<OutgoingBidiMessage>>;
|
|
23
|
+
static createResolved(message: ChromiumBidi.Message, channel?: string | null): Promise<Result<OutgoingBidiMessage>>;
|
|
23
24
|
get message(): ChromiumBidi.Message;
|
|
24
25
|
get channel(): string | null;
|
|
25
26
|
}
|
|
@@ -20,15 +20,26 @@ exports.OutgoingBidiMessage = void 0;
|
|
|
20
20
|
class OutgoingBidiMessage {
|
|
21
21
|
#message;
|
|
22
22
|
#channel;
|
|
23
|
-
constructor(message, channel) {
|
|
23
|
+
constructor(message, channel = null) {
|
|
24
24
|
this.#message = message;
|
|
25
25
|
this.#channel = channel;
|
|
26
26
|
}
|
|
27
|
-
static
|
|
28
|
-
return messagePromise.then((message) =>
|
|
27
|
+
static createFromPromise(messagePromise, channel) {
|
|
28
|
+
return messagePromise.then((message) => {
|
|
29
|
+
if (message.kind === 'success') {
|
|
30
|
+
return {
|
|
31
|
+
kind: 'success',
|
|
32
|
+
value: new OutgoingBidiMessage(message.value, channel),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return message;
|
|
36
|
+
});
|
|
29
37
|
}
|
|
30
38
|
static createResolved(message, channel) {
|
|
31
|
-
return Promise.resolve(
|
|
39
|
+
return Promise.resolve({
|
|
40
|
+
kind: 'success',
|
|
41
|
+
value: new OutgoingBidiMessage(message, channel),
|
|
42
|
+
});
|
|
32
43
|
}
|
|
33
44
|
get message() {
|
|
34
45
|
return this.#message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutgoingBidiMessage.js","sourceRoot":"","sources":["../../../src/bidiMapper/OutgoingBidiMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;
|
|
1
|
+
{"version":3,"file":"OutgoingBidiMessage.js","sourceRoot":"","sources":["../../../src/bidiMapper/OutgoingBidiMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAKH,MAAa,mBAAmB;IACrB,QAAQ,CAAuB;IAC/B,QAAQ,CAAgB;IAEjC,YACE,OAA6B,EAC7B,UAAyB,IAAI;QAE7B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,iBAAiB,CACtB,cAAqD,EACrD,OAAsB;QAEtB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACrC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;gBAC9B,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,IAAI,mBAAmB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;iBACvD,CAAC;aACH;YACD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,cAAc,CACnB,OAA6B,EAC7B,OAAuB;QAEvB,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,IAAI,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;SACjD,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AA5CD,kDA4CC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Google LLC.
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { EmptyResult } from '../../../protocol/protocol.js';
|
|
18
|
+
import type { ICdpConnection } from '../../bidiMapper';
|
|
19
|
+
export declare class BrowserProcessor {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(cdpConnection: ICdpConnection);
|
|
22
|
+
close(): EmptyResult;
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023 Google LLC.
|
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.BrowserProcessor = void 0;
|
|
20
|
+
class BrowserProcessor {
|
|
21
|
+
#cdpConnection;
|
|
22
|
+
constructor(cdpConnection) {
|
|
23
|
+
this.#cdpConnection = cdpConnection;
|
|
24
|
+
}
|
|
25
|
+
close() {
|
|
26
|
+
const client = this.#cdpConnection.browserClient();
|
|
27
|
+
// Ensure that it is put at the end of the event loop.
|
|
28
|
+
// This way we send back the response before closing the tab.
|
|
29
|
+
setTimeout(() => client.sendCommand('Browser.close'), 0);
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.BrowserProcessor = BrowserProcessor;
|
|
34
|
+
//# sourceMappingURL=BrowserProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/browser/BrowserProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAKH,MAAa,gBAAgB;IAC3B,cAAc,CAAiB;IAE/B,YAAY,aAA6B;QACvC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAED,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QAEnD,sDAAsD;QACtD,6DAA6D;QAC7D,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAhBD,4CAgBC"}
|
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
import type { Protocol } from 'devtools-protocol';
|
|
18
18
|
import { BrowsingContext, type EmptyResult } from '../../../protocol/protocol.js';
|
|
19
19
|
import { type LoggerFn } from '../../../utils/log.js';
|
|
20
|
-
import type {
|
|
20
|
+
import type { EventManager } from '../events/EventManager.js';
|
|
21
21
|
import { Realm } from '../script/realm.js';
|
|
22
22
|
import type { RealmStorage } from '../script/realmStorage.js';
|
|
23
|
+
import type { Result } from '../../../utils/result.js';
|
|
23
24
|
import type { BrowsingContextStorage } from './browsingContextStorage.js';
|
|
24
25
|
import type { CdpTarget } from './cdpTarget.js';
|
|
25
26
|
export declare class BrowsingContextImpl {
|
|
26
27
|
#private;
|
|
28
|
+
static readonly LOGGER_PREFIX: "debug:browsingContext";
|
|
27
29
|
private constructor();
|
|
28
|
-
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, id: BrowsingContext.BrowsingContext, parentId: BrowsingContext.BrowsingContext | null, eventManager:
|
|
30
|
+
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, id: BrowsingContext.BrowsingContext, parentId: BrowsingContext.BrowsingContext | null, eventManager: EventManager, browsingContextStorage: BrowsingContextStorage, logger?: LoggerFn): BrowsingContextImpl;
|
|
29
31
|
static getTimestamp(): number;
|
|
30
32
|
/**
|
|
31
33
|
* @see https://html.spec.whatwg.org/multipage/document-sequences.html#navigable
|
|
@@ -53,7 +55,7 @@ export declare class BrowsingContextImpl {
|
|
|
53
55
|
updateCdpTarget(cdpTarget: CdpTarget): void;
|
|
54
56
|
get url(): string;
|
|
55
57
|
lifecycleLoaded(): Promise<void>;
|
|
56
|
-
targetUnblocked(): Promise<void
|
|
58
|
+
targetUnblocked(): Promise<Result<void>>;
|
|
57
59
|
getOrCreateSandbox(sandbox: string | undefined): Promise<Realm>;
|
|
58
60
|
serializeToBidiValue(maxDepth?: number, addParentField?: boolean): BrowsingContext.Info;
|
|
59
61
|
onTargetInfoChanged(params: Protocol.Target.TargetInfoChangedEvent): void;
|
|
@@ -23,6 +23,7 @@ const log_js_1 = require("../../../utils/log.js");
|
|
|
23
23
|
const unitConversions_js_1 = require("../../../utils/unitConversions.js");
|
|
24
24
|
const realm_js_1 = require("../script/realm.js");
|
|
25
25
|
class BrowsingContextImpl {
|
|
26
|
+
static LOGGER_PREFIX = `${log_js_1.LogType.debug}:browsingContext`;
|
|
26
27
|
/** The ID of this browsing context. */
|
|
27
28
|
#id;
|
|
28
29
|
/**
|
|
@@ -34,7 +35,6 @@ class BrowsingContextImpl {
|
|
|
34
35
|
#children = new Set();
|
|
35
36
|
#browsingContextStorage;
|
|
36
37
|
#deferreds = {
|
|
37
|
-
documentInitialized: new deferred_js_1.Deferred(),
|
|
38
38
|
Page: {
|
|
39
39
|
navigatedWithinDocument: new deferred_js_1.Deferred(),
|
|
40
40
|
lifecycleEvent: {
|
|
@@ -259,7 +259,6 @@ class BrowsingContextImpl {
|
|
|
259
259
|
}
|
|
260
260
|
if (params.name === 'init') {
|
|
261
261
|
this.#documentChanged(params.loaderId);
|
|
262
|
-
this.#deferreds.documentInitialized.resolve();
|
|
263
262
|
return;
|
|
264
263
|
}
|
|
265
264
|
if (params.name === 'commit') {
|
|
@@ -273,7 +272,6 @@ class BrowsingContextImpl {
|
|
|
273
272
|
const timestamp = BrowsingContextImpl.getTimestamp();
|
|
274
273
|
switch (params.name) {
|
|
275
274
|
case 'DOMContentLoaded':
|
|
276
|
-
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.resolve(params);
|
|
277
275
|
this.#eventManager.registerEvent({
|
|
278
276
|
type: 'event',
|
|
279
277
|
method: protocol_js_1.ChromiumBidi.BrowsingContext.EventNames.DomContentLoadedEvent,
|
|
@@ -284,9 +282,9 @@ class BrowsingContextImpl {
|
|
|
284
282
|
url: this.#url,
|
|
285
283
|
},
|
|
286
284
|
}, this.id);
|
|
285
|
+
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.resolve(params);
|
|
287
286
|
break;
|
|
288
287
|
case 'load':
|
|
289
|
-
this.#deferreds.Page.lifecycleEvent.load.resolve(params);
|
|
290
288
|
this.#eventManager.registerEvent({
|
|
291
289
|
type: 'event',
|
|
292
290
|
method: protocol_js_1.ChromiumBidi.BrowsingContext.EventNames.LoadEvent,
|
|
@@ -297,6 +295,7 @@ class BrowsingContextImpl {
|
|
|
297
295
|
url: this.#url,
|
|
298
296
|
},
|
|
299
297
|
}, this.id);
|
|
298
|
+
this.#deferreds.Page.lifecycleEvent.load.resolve(params);
|
|
300
299
|
break;
|
|
301
300
|
}
|
|
302
301
|
});
|
|
@@ -379,7 +378,7 @@ class BrowsingContextImpl {
|
|
|
379
378
|
new deferred_js_1.Deferred();
|
|
380
379
|
}
|
|
381
380
|
else {
|
|
382
|
-
this.#logger?.(
|
|
381
|
+
this.#logger?.(BrowsingContextImpl.LOGGER_PREFIX, 'Document changed (navigatedWithinDocument)');
|
|
383
382
|
}
|
|
384
383
|
return;
|
|
385
384
|
}
|
|
@@ -387,25 +386,19 @@ class BrowsingContextImpl {
|
|
|
387
386
|
this.#loaderId = loaderId;
|
|
388
387
|
}
|
|
389
388
|
#resetDeferredsIfFinished() {
|
|
390
|
-
if (this.#deferreds.documentInitialized.isFinished) {
|
|
391
|
-
this.#deferreds.documentInitialized = new deferred_js_1.Deferred();
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
this.#logger?.(log_js_1.LogType.browsingContexts, 'Document changed (document initialized)');
|
|
395
|
-
}
|
|
396
389
|
if (this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.isFinished) {
|
|
397
390
|
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded =
|
|
398
391
|
new deferred_js_1.Deferred();
|
|
399
392
|
}
|
|
400
393
|
else {
|
|
401
|
-
this.#logger?.(
|
|
394
|
+
this.#logger?.(BrowsingContextImpl.LOGGER_PREFIX, 'Document changed (DOMContentLoaded)');
|
|
402
395
|
}
|
|
403
396
|
if (this.#deferreds.Page.lifecycleEvent.load.isFinished) {
|
|
404
397
|
this.#deferreds.Page.lifecycleEvent.load =
|
|
405
398
|
new deferred_js_1.Deferred();
|
|
406
399
|
}
|
|
407
400
|
else {
|
|
408
|
-
this.#logger?.(
|
|
401
|
+
this.#logger?.(BrowsingContextImpl.LOGGER_PREFIX, 'Document changed (load)');
|
|
409
402
|
}
|
|
410
403
|
}
|
|
411
404
|
async navigate(url, wait) {
|