adoptElementHandle method

Future<ElementHandle> adoptElementHandle(
  1. ElementHandle elementHandle
)

Implementation

Future<ElementHandle> adoptElementHandle(ElementHandle elementHandle) async {
  assert(elementHandle.executionContext != this,
      'Cannot adopt handle that already belongs to this execution context');
  assert(world != null, 'Cannot adopt handle without DOMWorld');

  var nodeInfo = await domApi.describeNode(
      objectId: elementHandle.remoteObject.objectId);
  return adoptBackendNodeId(nodeInfo.backendNodeId);
}