playwright-core 1.58.0-alpha-2025-12-10 → 1.58.0-alpha-2025-12-12
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/ThirdPartyNotices.txt +3 -3
- package/browsers.json +2 -2
- package/lib/client/browser.js +3 -5
- package/lib/client/browserType.js +2 -2
- package/lib/client/fetch.js +2 -4
- package/lib/client/page.js +4 -3
- package/lib/mcpBundleImpl/index.js +29 -29
- package/lib/protocol/serializers.js +5 -0
- package/lib/protocol/validator.js +26 -8
- package/lib/server/agent/actionRunner.js +33 -2
- package/lib/server/agent/agent.js +28 -12
- package/lib/server/agent/backend.js +2 -5
- package/lib/server/agent/codegen.js +83 -0
- package/lib/server/agent/context.js +43 -11
- package/lib/server/agent/tools.js +67 -5
- package/lib/server/artifact.js +1 -1
- package/lib/server/chromium/crPage.js +5 -5
- package/lib/server/codegen/javascript.js +6 -29
- package/lib/server/dispatchers/dispatcher.js +5 -8
- package/lib/server/dispatchers/pageDispatcher.js +3 -2
- package/lib/server/firefox/ffBrowser.js +1 -1
- package/lib/server/firefox/ffPage.js +1 -1
- package/lib/server/instrumentation.js +3 -0
- package/lib/server/page.js +2 -2
- package/lib/server/progress.js +2 -0
- package/lib/server/screencast.js +24 -25
- package/lib/server/videoRecorder.js +20 -11
- package/lib/server/webkit/wkBrowser.js +1 -1
- package/lib/server/webkit/wkPage.js +7 -7
- package/lib/utils/isomorphic/stringUtils.js +29 -0
- package/lib/vite/htmlReport/index.html +1 -1
- package/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/index.zFV_GQE-.js +2 -0
- package/lib/vite/traceViewer/sw.bundle.js +3 -1
- package/package.json +1 -1
- package/types/types.d.ts +27 -2
- package/lib/vite/traceViewer/index.C4Y3Aw8n.css +0 -1
- package/lib/vite/traceViewer/index.YskCIlQ-.js +0 -2
package/ThirdPartyNotices.txt
CHANGED
|
@@ -4,7 +4,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
|
4
4
|
|
|
5
5
|
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
|
|
6
6
|
|
|
7
|
-
- @lowire/loop@0.0.
|
|
7
|
+
- @lowire/loop@0.0.8 (https://github.com/pavelfeldman/lowire)
|
|
8
8
|
- @modelcontextprotocol/sdk@1.24.2 (https://github.com/modelcontextprotocol/typescript-sdk)
|
|
9
9
|
- accepts@2.0.0 (https://github.com/jshttp/accepts)
|
|
10
10
|
- agent-base@7.1.4 (https://github.com/TooTallNate/proxy-agents)
|
|
@@ -135,7 +135,7 @@ This project incorporates components from the projects listed below. The origina
|
|
|
135
135
|
- zod-to-json-schema@3.25.0 (https://github.com/StefanTerdell/zod-to-json-schema)
|
|
136
136
|
- zod@3.25.76 (https://github.com/colinhacks/zod)
|
|
137
137
|
|
|
138
|
-
%% @lowire/loop@0.0.
|
|
138
|
+
%% @lowire/loop@0.0.8 NOTICES AND INFORMATION BEGIN HERE
|
|
139
139
|
=========================================
|
|
140
140
|
Apache License
|
|
141
141
|
Version 2.0, January 2004
|
|
@@ -339,7 +339,7 @@ Apache License
|
|
|
339
339
|
See the License for the specific language governing permissions and
|
|
340
340
|
limitations under the License.
|
|
341
341
|
=========================================
|
|
342
|
-
END OF @lowire/loop@0.0.
|
|
342
|
+
END OF @lowire/loop@0.0.8 AND INFORMATION
|
|
343
343
|
|
|
344
344
|
%% @modelcontextprotocol/sdk@1.24.2 NOTICES AND INFORMATION BEGIN HERE
|
|
345
345
|
=========================================
|
package/browsers.json
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"name": "chromium-tip-of-tree",
|
|
20
|
-
"revision": "
|
|
20
|
+
"revision": "1390",
|
|
21
21
|
"installByDefault": false,
|
|
22
22
|
"browserVersion": "144.0.7559.3",
|
|
23
23
|
"title": "Chrome Canary for Testing"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "chromium-tip-of-tree-headless-shell",
|
|
27
|
-
"revision": "
|
|
27
|
+
"revision": "1390",
|
|
28
28
|
"installByDefault": false,
|
|
29
29
|
"browserVersion": "144.0.7559.3",
|
|
30
30
|
"title": "Chrome Canary Headless Shell"
|
package/lib/client/browser.js
CHANGED
|
@@ -62,11 +62,9 @@ class Browser extends import_channelOwner.ChannelOwner {
|
|
|
62
62
|
context._onClose();
|
|
63
63
|
await this._channel.disconnectFromReusedContext({ reason });
|
|
64
64
|
}
|
|
65
|
-
async _innerNewContext(
|
|
66
|
-
options = this._browserType._playwright.selectors._withSelectorOptions(
|
|
67
|
-
|
|
68
|
-
...options
|
|
69
|
-
});
|
|
65
|
+
async _innerNewContext(userOptions = {}, forReuse) {
|
|
66
|
+
const options = this._browserType._playwright.selectors._withSelectorOptions(userOptions);
|
|
67
|
+
await this._instrumentation.runBeforeCreateBrowserContext(options);
|
|
70
68
|
const contextOptions = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
|
|
71
69
|
const response = forReuse ? await this._channel.newContextForReuse(contextOptions) : await this._channel.newContext(contextOptions);
|
|
72
70
|
const context = import_browserContext.BrowserContext.from(response.context);
|
|
@@ -73,13 +73,13 @@ class BrowserType extends import_channelOwner.ChannelOwner {
|
|
|
73
73
|
return await this._serverLauncher.launchServer(options);
|
|
74
74
|
}
|
|
75
75
|
async launchPersistentContext(userDataDir, options = {}) {
|
|
76
|
-
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
|
|
77
76
|
(0, import_assert.assert)(!options.port, "Cannot specify a port without launching as a server.");
|
|
78
77
|
options = this._playwright.selectors._withSelectorOptions({
|
|
79
78
|
...this._playwright._defaultLaunchOptions,
|
|
80
|
-
...this._playwright._defaultContextOptions,
|
|
81
79
|
...options
|
|
82
80
|
});
|
|
81
|
+
await this._instrumentation.runBeforeCreateBrowserContext(options);
|
|
82
|
+
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
|
|
83
83
|
const contextParams = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
|
|
84
84
|
const persistentParams = {
|
|
85
85
|
...contextParams,
|
package/lib/client/fetch.js
CHANGED
|
@@ -39,10 +39,8 @@ class APIRequest {
|
|
|
39
39
|
this._playwright = playwright;
|
|
40
40
|
}
|
|
41
41
|
async newContext(options = {}) {
|
|
42
|
-
options = {
|
|
43
|
-
|
|
44
|
-
...options
|
|
45
|
-
};
|
|
42
|
+
options = { ...options };
|
|
43
|
+
await this._playwright._instrumentation.runBeforeCreateRequestContext(options);
|
|
46
44
|
const storageState = typeof options.storageState === "string" ? JSON.parse(await this._playwright._platform.fs().promises.readFile(options.storageState, "utf8")) : options.storageState;
|
|
47
45
|
const context = APIRequestContext.from((await this._playwright._channel.newRequest({
|
|
48
46
|
...options,
|
package/lib/client/page.js
CHANGED
|
@@ -675,11 +675,12 @@ class Page extends import_channelOwner.ChannelOwner {
|
|
|
675
675
|
return result.pdf;
|
|
676
676
|
}
|
|
677
677
|
async perform(task, options = {}) {
|
|
678
|
-
await this._channel.perform({ task, ...options });
|
|
678
|
+
const result = await this._channel.perform({ task, ...options });
|
|
679
|
+
return { usage: { ...result } };
|
|
679
680
|
}
|
|
680
681
|
async extract(query, schema, options = {}) {
|
|
681
|
-
const { result } = await this._channel.extract({ query, schema: this._platform.zodToJsonSchema(schema), ...options });
|
|
682
|
-
return result;
|
|
682
|
+
const { result, ...usage } = await this._channel.extract({ query, schema: this._platform.zodToJsonSchema(schema), ...options });
|
|
683
|
+
return { result, usage };
|
|
683
684
|
}
|
|
684
685
|
async _snapshotForAI(options = {}) {
|
|
685
686
|
return await this._channel.snapshotForAI({ timeout: this._timeoutSettings.timeout(options), track: options.track });
|