File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
plugins/default-browser-emulator/lib Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,11 @@ export default class DomOverridesBuilder {
25
25
{
26
26
// NOTE: don't make this async. It can cause issues if you read a frame right after creation, for instance
27
27
script : `(function newDocumentScript() {
28
+ // Worklet has no scope to override, but we can't detect until it loads
29
+ if (typeof self === 'undefined' && typeof window === 'undefined') return;
30
+
28
31
const sourceUrl = '${ injectedSourceUrl } ';
32
+
29
33
${ utilsScript }
30
34
31
35
${ scripts . join ( '\n\n' ) }
Original file line number Diff line number Diff line change @@ -198,6 +198,12 @@ export default class FramesManager extends TypedEventEmitter<IPuppetFrameManager
198
198
await this . isReady ;
199
199
const { context } = event ;
200
200
const frameId = context . auxData . frameId as string ;
201
+ const type = context . auxData . type as string ;
202
+
203
+ const defaultScope =
204
+ type === 'default' && context . auxData . isDefault === true && context . name === '' ;
205
+ const isolatedScope = type === 'isolated' && context . name === ISOLATED_WORLD ;
206
+ if ( ! isolatedScope && ! defaultScope ) return ;
201
207
202
208
this . activeContextIds . add ( context . id ) ;
203
209
const frame = this . framesById . get ( frameId ) ;
@@ -207,7 +213,7 @@ export default class FramesManager extends TypedEventEmitter<IPuppetFrameManager
207
213
executionContextId : context . id ,
208
214
} ) ;
209
215
}
210
- frame ?. addContextId ( context . id , context . name === '' || context . auxData ?. isDefault === true ) ;
216
+ frame ?. addContextId ( context . id , defaultScope ) ;
211
217
}
212
218
213
219
/////// FRAMES ///////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments