{ "domain": "Replay", "description": "Controls web replay, and manages recording sessions and segments.", "featureGuard": "ENABLE(WEB_REPLAY)", "availability": "web", "types": [ { "id": "SessionIdentifier", "description": "Unique replay session identifier.", "type": "integer" }, { "id": "SegmentIdentifier", "description": "Unique session segment identifier.", "type": "integer" }, { "id": "SessionState", "description": "State machine's state for the session.", "type": "string", "enum": ["Capturing", "Inactive", "Replaying"] }, { "id": "SegmentState", "description": "State machine's state for the session segment.", "type": "string", "enum": ["Appending", "Unloaded", "Loaded", "Dispatching"] }, { "id": "ReplayPosition", "type": "object", "properties": [ { "name": "segmentOffset", "type": "integer", "description": "Offset for a segment within the currently-loaded replay session." }, { "name": "inputOffset", "type": "integer", "description": "Offset for an event loop input within the specified session segment." } ] }, { "id": "ReplayInput", "type": "object", "properties": [ { "name": "type", "type": "string", "description": "Input type." }, { "name": "offset", "type": "integer", "description": "Offset of this input in its respective queue."}, { "name": "data", "type": "object", "description": "Per-input payload." } ] }, { "id": "ReplayInputQueue", "type": "object", "properties": [ { "name": "type", "type": "string", "description": "Queue type" }, { "name": "inputs", "type": "array", "items": { "$ref": "ReplayInput"}, "description": "Inputs belonging to this queue." } ] }, { "id": "SessionSegment", "description": "A standalone segment of a replay session that corresponds to a single main frame navigation and execution.", "type": "object", "properties": [ { "name": "id", "$ref": "SegmentIdentifier", "description": "Unique session segment identifier." }, { "name": "timestamp", "type": "number", "description": "Start time of the segment, in milliseconds since the epoch." }, { "name": "queues", "type": "array", "items": { "$ref": "ReplayInputQueue"} } ] }, { "id": "ReplaySession", "description": "An ordered collection of replay session segments.", "type": "object", "properties": [ { "name": "id", "$ref": "SessionIdentifier", "description": "Unique replay session identifier." }, { "name": "timestamp", "type": "number", "description": "Creation time of session, in milliseconds since the epoch." }, { "name": "segments", "type": "array", "items": { "$ref": "SegmentIdentifier" }, "description": "An ordered list identifiers for the segments that comprise this replay session." } ] } ], "commands": [ { "name": "startCapturing", "description": "Starts capture of a new replay session." }, { "name": "stopCapturing", "description": "Stops capture of the currently recording replay session." }, { "name": "replayToPosition", "description": "Seek execution to a specific position within the replay session.", "parameters": [ { "name": "position", "$ref": "ReplayPosition" }, { "name": "shouldFastForward", "type": "boolean" } ] }, { "name": "replayToCompletion", "description": "Replay all session segments completely.", "parameters": [ { "name": "shouldFastForward", "type": "boolean" } ] }, { "name": "pausePlayback", "description": "Pauses playback in the current segment. Can be resumed by using a replay command." }, { "name": "cancelPlayback", "description": "Cancels playback of the current segment. Further replaying will start from the beginning of the current segment." }, { "name": "switchSession", "description": "Unloads the current replay session and loads the specified session", "parameters": [ { "name": "sessionIdentifier", "$ref": "SessionIdentifier" } ] }, { "name": "insertSessionSegment", "description": "Splices the specified session segment into the session at the specified index.", "parameters": [ { "name": "sessionIdentifier", "$ref": "SessionIdentifier" }, { "name": "segmentIdentifier", "$ref": "SegmentIdentifier" }, { "name": "segmentIndex", "type": "integer" } ] }, { "name": "removeSessionSegment", "description": "Removes the session segment at the specified position from the session.", "parameters": [ { "name": "sessionIdentifier", "$ref": "SessionIdentifier" }, { "name": "segmentIndex", "type": "integer" } ] }, { "name": "currentReplayState", "description": "Returns the identifier, position, session state and segment state of the currently loaded session. This is necessary because the inspector may be closed and reopened in the middle of replay.", "returns": [ { "name": "sessionIdentifier", "$ref": "SessionIdentifier" }, { "name": "segmentIdentifier", "$ref": "SegmentIdentifier", "optional": true, "description": "If no segment is currently loaded, then there is no valid segment identifier." }, { "name": "sessionState", "$ref": "SessionState" }, { "name": "segmentState", "$ref": "SegmentState" }, { "name": "replayPosition", "$ref": "ReplayPosition" } ] }, { "name": "getAvailableSessions", "description": "Returns identifiers of all available sessions.", "returns": [ { "name": "ids", "type": "array", "items": { "$ref": "SessionIdentifier" } } ] }, { "name": "getSessionData", "description": "Returns an object for the specified session.", "parameters": [ { "name": "sessionIdentifier", "$ref": "SessionIdentifier" } ], "returns": [ { "name": "session", "$ref": "ReplaySession", "optional": true, "description": "The requested serialized replay session." } ] }, { "name": "getSegmentData", "description": "Returns an object for the specified session segment.", "parameters": [ { "name": "id", "$ref": "SegmentIdentifier" } ], "returns": [ { "name": "segment", "$ref": "SessionSegment", "optional": true, "description": "The requested serialized session segment." } ] } ], "events": [ { "name": "captureStarted", "description": "Fired when capture has started." }, { "name": "captureStopped", "description": "Fired when capture has stopped." }, { "name": "playbackHitPosition", "description": "Playback within the session has progressed up to this position, and is about to replay the input at the specified offset.", "parameters": [ { "name": "position", "$ref": "ReplayPosition", "description": "The playback position that was hit." }, { "name": "timestamp", "type": "number", "description": "A timestamp for the event." } ] }, { "name": "playbackStarted", "description": "Fired when session playback has started." }, { "name": "playbackPaused", "description": "Fired when session playback has paused, but not finished.", "parameters": [ { "name": "position", "$ref": "ReplayPosition", "description": "The playback position immediately prior to where playback is paused." } ] }, { "name": "playbackFinished", "description": "Fired when session playback has stopped." }, { "name": "inputSuppressionChanged", "description": "Fired when the replay controller starts or stops suppressing user inputs.", "parameters": [ { "name": "willSuppress", "type": "boolean", "description": "Whether user inputs will be suppressed during playback." } ] }, { "name": "sessionCreated", "description": "Fired when a new replay session is created", "parameters": [ { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the created session." } ] }, { "name": "sessionModified", "description": "Fired when a session's segments have changed.", "parameters": [ { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the session the segment was added to." } ] }, { "name": "sessionRemoved", "description": "Fired when a replay session is removed and can no longer be loaded.", "parameters": [ { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the removed session." } ] }, { "name": "sessionLoaded", "description": "Fired when a replay session is loaded.", "parameters": [ { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the loaded session." } ] }, { "name": "segmentCreated", "description": "Fired when a new session segment is created.", "parameters": [ { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the created session segment." } ] }, { "name": "segmentRemoved", "description": "Fired when a session segment is removed and can no longer be replayed as part of a session.", "parameters": [ { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the removed session segment." } ] }, { "name": "segmentCompleted", "description": "Fired when a session segment is completed and can no longer have inputs added to it.", "parameters": [ { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the completed session segment." } ] }, { "name": "segmentLoaded", "description": "Fired when a segment is loaded.", "parameters": [ { "name": "segmentIdentifier", "$ref": "SegmentIdentifier", "description": "Id for the loaded segment." } ] }, { "name": "segmentUnloaded", "description": "Fired when a segment is unloaded." } ] }