createIsolatedWorld method

Future<ExecutionContextId> createIsolatedWorld(
  1. FrameId frameId, {
  2. String? worldName,
  3. bool? grantUniveralAccess,
})

Creates an isolated world for the given frame. frameId Id of the frame in which the isolated world should be created. worldName An optional name which is reported in the Execution Context. grantUniveralAccess Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution. Returns: Execution context of the isolated world.

Implementation

Future<runtime.ExecutionContextId> createIsolatedWorld(FrameId frameId,
    {String? worldName, bool? grantUniveralAccess}) async {
  var result = await _client.send('Page.createIsolatedWorld', {
    'frameId': frameId,
    if (worldName != null) 'worldName': worldName,
    if (grantUniveralAccess != null)
      'grantUniveralAccess': grantUniveralAccess,
  });
  return runtime.ExecutionContextId.fromJson(
      result['executionContextId'] as int);
}