summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/inspector/protocol/Replay.json
blob: 7bc26bda726bed650055566f29d74e6b6d78a908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
{
    "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."
        }
    ]
}