@@ -337,7 +337,7 @@ func (f *Frame) document() (*ElementHandle, error) {
337
337
return f .documentHandle , err
338
338
}
339
339
340
- func (f * Frame ) hasContext (world string ) bool {
340
+ func (f * Frame ) hasContext (world executionWorld ) bool {
341
341
f .executionContextMu .RLock ()
342
342
defer f .executionContextMu .RUnlock ()
343
343
@@ -443,7 +443,7 @@ func (f *Frame) requestByID(reqID network.RequestID) *Request {
443
443
return frameSession .networkManager .requestFromID (reqID )
444
444
}
445
445
446
- func (f * Frame ) setContext (world string , execCtx frameExecutionContext ) {
446
+ func (f * Frame ) setContext (world executionWorld , execCtx frameExecutionContext ) {
447
447
f .executionContextMu .Lock ()
448
448
defer f .executionContextMu .Unlock ()
449
449
@@ -472,7 +472,7 @@ func (f *Frame) setID(id cdp.FrameID) {
472
472
f .id = id
473
473
}
474
474
475
- func (f * Frame ) waitForExecutionContext (world string ) {
475
+ func (f * Frame ) waitForExecutionContext (world executionWorld ) {
476
476
f .log .Debugf ("Frame:waitForExecutionContext" , "fid:%s furl:%q world:%s" ,
477
477
f .ID (), f .URL (), world )
478
478
@@ -490,7 +490,7 @@ func (f *Frame) waitForExecutionContext(world string) {
490
490
}
491
491
}
492
492
493
- func (f * Frame ) waitForFunction (apiCtx context.Context , world string , predicateFn goja.Value , polling PollingType , interval int64 , timeout time.Duration , args ... goja.Value ) (interface {}, error ) {
493
+ func (f * Frame ) waitForFunction (apiCtx context.Context , world executionWorld , predicateFn goja.Value , polling PollingType , interval int64 , timeout time.Duration , args ... goja.Value ) (interface {}, error ) {
494
494
f .log .Debugf (
495
495
"Frame:waitForFunction" ,
496
496
"fid:%s furl:%q world:%s pt:%s timeout:%s" ,
@@ -1434,15 +1434,15 @@ func (f *Frame) WaitForTimeout(timeout int64) {
1434
1434
}
1435
1435
}
1436
1436
1437
- func (f * Frame ) adoptBackendNodeID (world string , id cdp.BackendNodeID ) (* ElementHandle , error ) {
1437
+ func (f * Frame ) adoptBackendNodeID (world executionWorld , id cdp.BackendNodeID ) (* ElementHandle , error ) {
1438
1438
f .executionContextMu .RLock ()
1439
1439
defer f .executionContextMu .RUnlock ()
1440
1440
1441
1441
ec := f .getExecCtx (world )
1442
1442
return ec .adoptBackendNodeID (id )
1443
1443
}
1444
1444
1445
- func (f * Frame ) evaluate (world string , apiCtx context.Context , opts evaluateOptions , pageFunc goja.Value , args ... goja.Value ) (res interface {}, err error ) {
1445
+ func (f * Frame ) evaluate (world executionWorld , apiCtx context.Context , opts evaluateOptions , pageFunc goja.Value , args ... goja.Value ) (res interface {}, err error ) {
1446
1446
f .executionContextMu .RLock ()
1447
1447
defer f .executionContextMu .RUnlock ()
1448
1448
@@ -1452,7 +1452,7 @@ func (f *Frame) evaluate(world string, apiCtx context.Context, opts evaluateOpti
1452
1452
1453
1453
// getExecCtx returns an execution context using a given world name.
1454
1454
// Unsafe to use concurrently.
1455
- func (f * Frame ) getExecCtx (world string ) frameExecutionContext {
1455
+ func (f * Frame ) getExecCtx (world executionWorld ) frameExecutionContext {
1456
1456
ec := f .mainExecutionContext
1457
1457
if world == utilityWorld {
1458
1458
ec = f .utilityExecutionContext
0 commit comments