playwright-core 1.55.0-alpha-2025-08-06 → 1.55.0-alpha-2025-08-08
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/client/browser.js +9 -11
- package/lib/client/browserContext.js +1 -1
- package/lib/client/browserType.js +6 -5
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/server/browserType.js +1 -1
- package/lib/server/chromium/chromium.js +1 -1
- package/lib/server/frames.js +2 -2
- package/lib/server/page.js +1 -1
- package/lib/server/utils/debug.js +1 -1
- package/lib/server/utils/nodePlatform.js +1 -1
- package/lib/utils/isomorphic/protocolFormatter.js +25 -20
- package/lib/utils/isomorphic/protocolMetainfo.js +6 -6
- package/lib/vite/traceViewer/assets/{codeMirrorModule-DieI-Eix.js → codeMirrorModule-kKV6wiKW.js} +1 -1
- package/lib/vite/traceViewer/assets/defaultSettingsView-B8m-Tp96.js +256 -0
- package/lib/vite/traceViewer/{index.Dloe-aCz.js → index.B5W4G6Lz.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.DEbRpPOO.js → uiMode.BYPxfXTB.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/package.json +1 -1
- package/types/types.d.ts +2 -2
- package/lib/vite/traceViewer/assets/defaultSettingsView-D3X2EJQX.js +0 -256
package/lib/client/browser.js
CHANGED
|
@@ -50,19 +50,17 @@ class Browser extends import_channelOwner.ChannelOwner {
|
|
|
50
50
|
return await this._innerNewContext(options, false);
|
|
51
51
|
}
|
|
52
52
|
async _newContextForReuse(options = {}) {
|
|
53
|
-
return await this.
|
|
53
|
+
return await this._innerNewContext(options, true);
|
|
54
54
|
}
|
|
55
55
|
async _disconnectFromReusedContext(reason) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
await this._channel.disconnectFromReusedContext({ reason });
|
|
65
|
-
}, { internal: true });
|
|
56
|
+
const context = [...this._contexts].find((context2) => context2._forReuse);
|
|
57
|
+
if (!context)
|
|
58
|
+
return;
|
|
59
|
+
await this._instrumentation.runBeforeCloseBrowserContext(context);
|
|
60
|
+
for (const page of context.pages())
|
|
61
|
+
page._onClose();
|
|
62
|
+
context._onClose();
|
|
63
|
+
await this._channel.disconnectFromReusedContext({ reason });
|
|
66
64
|
}
|
|
67
65
|
async _innerNewContext(options = {}, forReuse) {
|
|
68
66
|
options = this._browserType._playwright.selectors._withSelectorOptions({
|
|
@@ -434,8 +434,8 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
|
|
|
434
434
|
this._closeReason = options.reason;
|
|
435
435
|
this._closingStatus = "closing";
|
|
436
436
|
await this.request.dispose(options);
|
|
437
|
+
await this._instrumentation.runBeforeCloseBrowserContext(this);
|
|
437
438
|
await this._wrapApiCall(async () => {
|
|
438
|
-
await this._instrumentation.runBeforeCloseBrowserContext(this);
|
|
439
439
|
for (const [harId, harParams] of this._harRecorders) {
|
|
440
440
|
const har = await this._channel.harExport({ harId });
|
|
441
441
|
const artifact = import_artifact.Artifact.from(har.artifact);
|
|
@@ -90,15 +90,16 @@ class BrowserType extends import_channelOwner.ChannelOwner {
|
|
|
90
90
|
userDataDir: this._platform.path().isAbsolute(userDataDir) || !userDataDir ? userDataDir : this._platform.path().resolve(userDataDir),
|
|
91
91
|
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).launchTimeout(options)
|
|
92
92
|
};
|
|
93
|
-
|
|
93
|
+
const context = await this._wrapApiCall(async () => {
|
|
94
94
|
const result = await this._channel.launchPersistentContext(persistentParams);
|
|
95
95
|
const browser = import_browser.Browser.from(result.browser);
|
|
96
96
|
browser._connectToBrowserType(this, options, logger);
|
|
97
|
-
const
|
|
98
|
-
await
|
|
99
|
-
|
|
100
|
-
return context;
|
|
97
|
+
const context2 = import_browserContext.BrowserContext.from(result.context);
|
|
98
|
+
await context2._initializeHarFromOptions(options.recordHar);
|
|
99
|
+
return context2;
|
|
101
100
|
});
|
|
101
|
+
await this._instrumentation.runAfterCreateBrowserContext(context);
|
|
102
|
+
return context;
|
|
102
103
|
}
|
|
103
104
|
async connect(optionsOrWsEndpoint, options) {
|
|
104
105
|
if (typeof optionsOrWsEndpoint === "string")
|