Runtime.json   [plain text]


{
    "domain": "Runtime",
    "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
    "types": [
        {
            "id": "RemoteObjectId",
            "type": "string",
            "description": "Unique object identifier."
        },
        {
            "id": "RemoteObject",
            "type": "object",
            "description": "Mirror object referencing original JavaScript object.",
            "properties": [
                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },
                { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
                { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
                { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },
                { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
                { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
                { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containsing abbreviated property values." }
            ]
        },
        {
            "id": "ObjectPreview",
            "type": "object",
            "description": "Object containing abbreviated remote object value.",
            "properties": [
                { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },
                { "name": "overflow", "type": "boolean", "description": "True iff some of the properties of the original did not fit." },
                { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." }
            ]
        },
        {
            "id": "PropertyPreview",
            "type": "object",
            "properties": [
                { "name": "name", "type": "string", "description": "Property name." },
                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },
                { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
                { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
                { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
            ]
        },
        {
            "id": "PropertyDescriptor",
            "type": "object",
            "description": "Object property descriptor.",
            "properties": [
                { "name": "name", "type": "string", "description": "Property name." },
                { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
                { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
                { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
                { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
                { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
                { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
                { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
                { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." }
            ]
        },
        {
            "id": "InternalPropertyDescriptor",
            "type": "object",
            "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
            "properties": [
                { "name": "name", "type": "string", "description": "Conventional property name." },
                { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
            ]
        },
        {
            "id": "CallArgument",
            "type": "object",
            "description": "Represents function call argument. Either remote object id <code>objectId</code> or primitive <code>value</code> or neither of (for undefined) them should be specified.",
            "properties": [
                { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },
                { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
            ]
        },
        {
            "id": "ExecutionContextId",
            "type": "integer",
            "description": "Id of an execution context."
        },
        {
            "id": "RuntimeFrameId",
            "type": "string",
            "description": "Unique frame identifier. FIXME: Duplicate of Network.FrameId <https://webkit.org/b/125664> Web Inspector: FIX Type Dependency Issues"
        },
        {
            "id": "ExecutionContextDescription",
            "type": "object",
            "description": "Description of an isolated world.",
            "properties": [
                { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
                { "name": "isPageContext", "type": "boolean", "description": "True if this is a context where inpspected web page scripts run. False if it is a content script isolated context." },
                { "name": "name", "type": "string", "description": "Human readable name describing given context."},
                { "name": "frameId", "$ref": "RuntimeFrameId", "description": "Id of the owning frame." }
            ]
        },
        {
            "id": "SyntaxErrorType",
            "type": "string",
            "enum": ["none", "irrecoverable", "unterminated-literal", "recoverable"],
            "description": "Syntax error type: \"none\" for no error, \"irrecoverable\" for unrecoverable errors, \"unterminated-literal\" for when there is an unterminated literal, \"recoverable\" for when the expression is unfinished but valid so far."
        },
        {
            "id": "ErrorRange",
            "type": "object",
            "description": "Range of an error in source code.",
            "properties": [
                { "name": "startOffset", "type": "integer", "description": "Start offset of range (inclusive)." },
                { "name": "endOffset", "type": "integer", "description": "End offset of range (exclusive)." }
            ]
        }
    ],
    "commands": [
        {
            "name": "parse",
            "parameters": [
                { "name": "source", "type": "string", "description": "Source code to parse." }
            ],
            "returns": [
                { "name": "result", "$ref": "SyntaxErrorType", "description": "Parse result." },
                { "name": "message", "type": "string", "optional": true, "description": "Parse error message." },
                { "name": "range", "$ref": "ErrorRange", "optional": true, "description": "Range in the source where the error occurred." }
            ],
            "description": "Parses JavaScript source code for errors."
        },
        {
            "name": "evaluate",
            "parameters": [
                { "name": "expression", "type": "string", "description": "Expression to evaluate." },
                { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
                { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
                { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state." },
                { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." },
                { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
                { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
            ],
            "returns": [
                { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
                { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
            ],
            "description": "Evaluates expression on global object."
        },
        {
            "name": "callFunctionOn",
            "parameters": [
                { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },
                { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
                { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
                { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state." },
                { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
                { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
            ],
            "returns": [
                { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
                { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
            ],
            "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
        },
        {
            "name": "getProperties",
            "parameters": [
                { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
                { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." }
            ],
            "returns": [
                { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." },
                { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor"}, "description": "Internal object properties." }
            ],
            "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
        },
        {
            "name": "releaseObject",
            "parameters": [
                { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
            ],
            "description": "Releases remote object with given id."
        },
        {
            "name": "releaseObjectGroup",
            "parameters": [
                { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
            ],
            "description": "Releases all remote objects that belong to a given group."
        },
        {
            "name": "run",
            "description": "Tells inspected instance(worker or page) that it can run in case it was started paused."
        },
        {
            "name": "enable",
            "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
        },
        {
            "name": "disable",
            "description": "Disables reporting of execution contexts creation."
        }
    ],
    "events": [
        {
            "name": "executionContextCreated",
            "parameters": [
                { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." }
            ],
            "description": "Issued when new execution context is created."
        }
    ]
}