← Back to Runtime domain

Runtime.getProperties

Returns properties of a given object. Object group of the result is inherited from the target object.

Domain: Runtime stable

Parameters

NameTypeDescription
objectIdRemoteObjectIdIdentifier of the object to return properties for.
ownProperties (optional)booleanIf true, returns properties belonging only to the element itself, not to its prototype chain.
accessorPropertiesOnly (optional)booleanIf true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
generatePreview (optional)booleanWhether preview should be generated for the results.
nonIndexedPropertiesOnly (optional)booleanIf true, returns non-indexed properties only.

Returns

NameTypeDescription
resultarrayObject properties.
internalPropertiesarrayInternal object properties (only of the element itself).
privatePropertiesarrayObject private properties.
exceptionDetailsExceptionDetailsException details.

Example Request

{
  "id": 1,
  "method": "Runtime.getProperties",
  "params": {
    "objectId": "{\"injectedScriptId\":1,\"id\":1}"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "result": {
      "type": "string",
      "value": "Example Domain"
    },
    "internalProperties": [],
    "privateProperties": [],
    "exceptionDetails": "exceptionDetails-value"
  }
}

Usage in Node.js

const result = await send('Runtime.getProperties', {"objectId": "{\"injectedScriptId\":1,\"id\":1}"});
console.log(result);
// {"result": {"type": "string", "value": "Example Domain"}, "internalProperties": [], "privateProperties": [], "exceptionDetails": "exceptionDetails-value"}