properties property

Future<Map<String, JsHandle>> get properties

The method returns a map with property names as keys and JSHandle instances for the property values.

var handle = await page.evaluateHandle('() => ({window, document})');
var properties = await handle.properties;
var windowHandle = properties['window'];
var documentHandle = properties['document']! as ElementHandle;
await handle.dispose();

Implementation

Future<Map<String, JsHandle>> get properties async {
  var response = await executionContext.runtimeApi.getProperties(
    remoteObject.objectId!,
    ownProperties: true,
  );
  var result = <String, JsHandle>{};
  for (var property in response.result) {
    if (!property.enumerable) continue;
    result[property.name] = JsHandle.fromRemoteObject(
      executionContext,
      property.value!,
    );
  }
  return result;
}