chromium-bidi 7.3.0 → 7.3.2
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/lib/cjs/bidiMapper/modules/browser/BrowserProcessor.js +1 -1
- package/lib/cjs/bidiMapper/modules/browser/BrowserProcessor.js.map +1 -1
- package/lib/cjs/bidiMapper/modules/browser/ContextConfig.d.ts +9 -1
- package/lib/cjs/bidiMapper/modules/browser/ContextConfig.js +23 -1
- package/lib/cjs/bidiMapper/modules/browser/ContextConfig.js.map +1 -1
- package/lib/cjs/bidiMapper/modules/browser/ContextConfigStorage.d.ts +35 -12
- package/lib/cjs/bidiMapper/modules/browser/ContextConfigStorage.js +40 -32
- package/lib/cjs/bidiMapper/modules/browser/ContextConfigStorage.js.map +1 -1
- package/lib/cjs/protocol/generated/webdriver-bidi.d.ts +1 -1
- package/lib/cjs/protocol-parser/generated/webdriver-bidi.js +1 -1
- package/lib/cjs/protocol-parser/generated/webdriver-bidi.js.map +1 -1
- package/lib/esm/bidiMapper/modules/browser/BrowserProcessor.js +1 -1
- package/lib/esm/bidiMapper/modules/browser/BrowserProcessor.js.map +1 -1
- package/lib/esm/bidiMapper/modules/browser/ContextConfig.d.ts +9 -1
- package/lib/esm/bidiMapper/modules/browser/ContextConfig.js +23 -1
- package/lib/esm/bidiMapper/modules/browser/ContextConfig.js.map +1 -1
- package/lib/esm/bidiMapper/modules/browser/ContextConfigStorage.d.ts +35 -12
- package/lib/esm/bidiMapper/modules/browser/ContextConfigStorage.js +40 -32
- package/lib/esm/bidiMapper/modules/browser/ContextConfigStorage.js.map +1 -1
- package/lib/esm/protocol/generated/webdriver-bidi.d.ts +1 -1
- package/lib/esm/protocol-parser/generated/webdriver-bidi.js +1 -1
- package/lib/esm/protocol-parser/generated/webdriver-bidi.js.map +1 -1
- package/lib/iife/mapperTab.js +24 -34
- package/lib/iife/mapperTab.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
import { ContextConfig } from './ContextConfig.js';
|
|
2
|
+
/**
|
|
3
|
+
* Manages context-specific configurations. This class allows setting
|
|
4
|
+
* configurations at three levels: global, user context, and browsing context.
|
|
5
|
+
*
|
|
6
|
+
* When `getActiveConfig` is called, it merges the configurations in a specific
|
|
7
|
+
* order of precedence: `global -> user context -> browsing context`. For each
|
|
8
|
+
* configuration property, the value from the highest-precedence level that has a
|
|
9
|
+
* non-`undefined` value is used.
|
|
10
|
+
*
|
|
11
|
+
* The `update` methods (`updateGlobalConfig`, `updateUserContextConfig`,
|
|
12
|
+
* `updateBrowsingContextConfig`) merge the provided configuration with the
|
|
13
|
+
* existing one at the corresponding level. Properties with `undefined` values in
|
|
14
|
+
* the provided configuration are ignored, preserving the existing value.
|
|
15
|
+
*/
|
|
2
16
|
export declare class ContextConfigStorage {
|
|
3
17
|
#private;
|
|
18
|
+
/**
|
|
19
|
+
* Updates the global configuration. Properties with `undefined` values in the
|
|
20
|
+
* provided `config` are ignored.
|
|
21
|
+
*/
|
|
4
22
|
updateGlobalConfig(config: ContextConfig): void;
|
|
23
|
+
/**
|
|
24
|
+
* Updates the configuration for a specific browsing context. Properties with
|
|
25
|
+
* `undefined` values in the provided `config` are ignored.
|
|
26
|
+
*/
|
|
5
27
|
updateBrowsingContextConfig(browsingContextId: string, config: ContextConfig): void;
|
|
28
|
+
/**
|
|
29
|
+
* Updates the configuration for a specific user context. Properties with
|
|
30
|
+
* `undefined` values in the provided `config` are ignored.
|
|
31
|
+
*/
|
|
6
32
|
updateUserContextConfig(userContext: string, config: ContextConfig): void;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
timezone?: string | null;
|
|
17
|
-
userPromptHandler?: import("../../../protocol/protocol.js").Session.UserPromptHandler;
|
|
18
|
-
};
|
|
33
|
+
/**
|
|
34
|
+
* Returns the current global configuration.
|
|
35
|
+
*/
|
|
36
|
+
getGlobalConfig(): ContextConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Calculates the active configuration by merging global, user context, and
|
|
39
|
+
* browsing context settings.
|
|
40
|
+
*/
|
|
41
|
+
getActiveConfig(topLevelBrowsingContextId: string, userContext: string): ContextConfig;
|
|
19
42
|
}
|
|
@@ -15,49 +15,57 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { ContextConfig } from './ContextConfig.js';
|
|
18
|
+
/**
|
|
19
|
+
* Manages context-specific configurations. This class allows setting
|
|
20
|
+
* configurations at three levels: global, user context, and browsing context.
|
|
21
|
+
*
|
|
22
|
+
* When `getActiveConfig` is called, it merges the configurations in a specific
|
|
23
|
+
* order of precedence: `global -> user context -> browsing context`. For each
|
|
24
|
+
* configuration property, the value from the highest-precedence level that has a
|
|
25
|
+
* non-`undefined` value is used.
|
|
26
|
+
*
|
|
27
|
+
* The `update` methods (`updateGlobalConfig`, `updateUserContextConfig`,
|
|
28
|
+
* `updateBrowsingContextConfig`) merge the provided configuration with the
|
|
29
|
+
* existing one at the corresponding level. Properties with `undefined` values in
|
|
30
|
+
* the provided configuration are ignored, preserving the existing value.
|
|
31
|
+
*/
|
|
18
32
|
export class ContextConfigStorage {
|
|
19
33
|
#global = new ContextConfig();
|
|
20
34
|
#userContextConfigs = new Map();
|
|
21
35
|
#browsingContextConfigs = new Map();
|
|
36
|
+
/**
|
|
37
|
+
* Updates the global configuration. Properties with `undefined` values in the
|
|
38
|
+
* provided `config` are ignored.
|
|
39
|
+
*/
|
|
22
40
|
updateGlobalConfig(config) {
|
|
23
|
-
this.#global =
|
|
41
|
+
this.#global = ContextConfig.merge(this.#global, config);
|
|
24
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Updates the configuration for a specific browsing context. Properties with
|
|
45
|
+
* `undefined` values in the provided `config` are ignored.
|
|
46
|
+
*/
|
|
25
47
|
updateBrowsingContextConfig(browsingContextId, config) {
|
|
26
|
-
|
|
27
|
-
this.#browsingContextConfigs.set(browsingContextId, {
|
|
28
|
-
...this.#browsingContextConfigs.get(browsingContextId),
|
|
29
|
-
...config,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.#browsingContextConfigs.set(browsingContextId, config);
|
|
34
|
-
}
|
|
48
|
+
this.#browsingContextConfigs.set(browsingContextId, ContextConfig.merge(this.#browsingContextConfigs.get(browsingContextId), config));
|
|
35
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Updates the configuration for a specific user context. Properties with
|
|
52
|
+
* `undefined` values in the provided `config` are ignored.
|
|
53
|
+
*/
|
|
36
54
|
updateUserContextConfig(userContext, config) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.#userContextConfigs.set(userContext, config);
|
|
45
|
-
}
|
|
55
|
+
this.#userContextConfigs.set(userContext, ContextConfig.merge(this.#userContextConfigs.get(userContext), config));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns the current global configuration.
|
|
59
|
+
*/
|
|
60
|
+
getGlobalConfig() {
|
|
61
|
+
return this.#global;
|
|
46
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Calculates the active configuration by merging global, user context, and
|
|
65
|
+
* browsing context settings.
|
|
66
|
+
*/
|
|
47
67
|
getActiveConfig(topLevelBrowsingContextId, userContext) {
|
|
48
|
-
|
|
49
|
-
if (userContext !== undefined &&
|
|
50
|
-
this.#userContextConfigs.has(userContext)) {
|
|
51
|
-
result = { ...result, ...this.#userContextConfigs.get(userContext) };
|
|
52
|
-
}
|
|
53
|
-
if (topLevelBrowsingContextId !== undefined &&
|
|
54
|
-
this.#browsingContextConfigs.has(topLevelBrowsingContextId)) {
|
|
55
|
-
result = {
|
|
56
|
-
...result,
|
|
57
|
-
...this.#browsingContextConfigs.get(topLevelBrowsingContextId),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
68
|
+
return ContextConfig.merge(this.#global, this.#userContextConfigs.get(userContext), this.#browsingContextConfigs.get(topLevelBrowsingContextId));
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
//# sourceMappingURL=ContextConfigStorage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextConfigStorage.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/modules/browser/ContextConfigStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,oBAAoB;IAC/B,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IAC9B,mBAAmB,GAAG,IAAI,GAAG,EAAyB,CAAC;IACvD,uBAAuB,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE3D,kBAAkB,CAAC,MAAqB;QACtC,IAAI,CAAC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"ContextConfigStorage.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/modules/browser/ContextConfigStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,oBAAoB;IAC/B,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IAC9B,mBAAmB,GAAG,IAAI,GAAG,EAAyB,CAAC;IACvD,uBAAuB,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE3D;;;OAGG;IACH,kBAAkB,CAAC,MAAqB;QACtC,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,2BAA2B,CACzB,iBAAyB,EACzB,MAAqB;QAErB,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAC9B,iBAAiB,EACjB,aAAa,CAAC,KAAK,CACjB,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,iBAAiB,CAAC,EACnD,MAAM,CACP,CACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,WAAmB,EAAE,MAAqB;QAChE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAC1B,WAAW,EACX,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CACvE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,yBAAiC,EAAE,WAAmB;QACpE,OAAO,aAAa,CAAC,KAAK,CACxB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,EACzC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAC5D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1434,7 +1434,7 @@ export declare namespace Network {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
export declare namespace Network {
|
|
1436
1436
|
type SetExtraHeadersParameters = {
|
|
1437
|
-
headers: [
|
|
1437
|
+
headers: [...Network.Header[]];
|
|
1438
1438
|
contexts?: [
|
|
1439
1439
|
BrowsingContext.BrowsingContext,
|
|
1440
1440
|
...BrowsingContext.BrowsingContext[]
|
|
@@ -1504,7 +1504,7 @@ export var Network;
|
|
|
1504
1504
|
})(Network || (Network = {}));
|
|
1505
1505
|
(function (Network) {
|
|
1506
1506
|
Network.SetExtraHeadersParametersSchema = z.lazy(() => z.object({
|
|
1507
|
-
headers: z.array(Network.HeaderSchema)
|
|
1507
|
+
headers: z.array(Network.HeaderSchema),
|
|
1508
1508
|
contexts: z
|
|
1509
1509
|
.array(BrowsingContext.BrowsingContextSchema)
|
|
1510
1510
|
.min(1)
|