rebrowser-playwright-core 1.47.2 → 1.47.100
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/README.md +2 -0
- package/lib/server/frames.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
>
|
|
6
6
|
> 🪄 It's designed to be a drop-in replacement for the original `playwright-core` without changing your codebase. Each major and minor version of this repo matches the original repo, patch version could differ due to changes related to the patch itself.
|
|
7
7
|
>
|
|
8
|
+
> ☝️ Make sure to read: [How to Access Main Context Objects from Isolated Context](https://rebrowser.net/blog/how-to-access-main-context-objects-from-isolated-context-in-puppeteer-and-playwright-23741)
|
|
9
|
+
>
|
|
8
10
|
> 🐛 Please report any issues in the [`rebrowser-patches`](https://github.com/rebrowser/rebrowser-patches/issues) repo.
|
|
9
11
|
|
|
10
12
|
# playwright-core
|
package/lib/server/frames.js
CHANGED
|
@@ -588,7 +588,7 @@ class Frame extends _instrumentation.SdkObject {
|
|
|
588
588
|
if (process.env['REBROWSER_PATCHES_RUNTIME_FIX_MODE'] !== '0') {
|
|
589
589
|
// rebrowser-patches: use only utility context, create it on demand and cache
|
|
590
590
|
if (this._isolatedContext !== undefined) {
|
|
591
|
-
return this._isolatedContext;
|
|
591
|
+
return Promise.resolve(this._isolatedContext);
|
|
592
592
|
}
|
|
593
593
|
const utilityWorldName = process.env['REBROWSER_PATCHES_UTILITY_WORLD_NAME'] !== '0' ? process.env['REBROWSER_PATCHES_UTILITY_WORLD_NAME'] || 'util' : '__playwright_utility_world__';
|
|
594
594
|
return this._page._delegate._mainFrameSession._client.send('Page.createIsolatedWorld', {
|
|
@@ -608,9 +608,14 @@ class Frame extends _instrumentation.SdkObject {
|
|
|
608
608
|
this._isolatedContext = new dom.FrameExecutionContext(delegate, this, 'utility');
|
|
609
609
|
return this._isolatedContext;
|
|
610
610
|
}).catch(error => {
|
|
611
|
-
|
|
611
|
+
if (error.message.includes('No frame for given id found')) {
|
|
612
|
+
// ignore, frame is already gone
|
|
613
|
+
return {
|
|
614
|
+
destroyedReason: 'Frame was detached'
|
|
615
|
+
};
|
|
616
|
+
}
|
|
612
617
|
_debugLogger.debugLogger.log('error', error);
|
|
613
|
-
console.error('[rebrowser-patches][frames._context] cannot create utility world');
|
|
618
|
+
console.error('[rebrowser-patches][frames._context] cannot create utility world, error:', error);
|
|
614
619
|
});
|
|
615
620
|
}
|
|
616
621
|
return this._contextData.get(world).contextPromise.then(contextOrDestroyedReason => {
|
package/package.json
CHANGED