2020-08-28 20:51:55 +03:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
export type ContextCreatedTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-08-28 20:51:55 +03:00
|
|
|
type: 'context-created',
|
|
|
|
browserName: string,
|
|
|
|
contextId: string,
|
|
|
|
deviceScaleFactor: number,
|
|
|
|
isMobile: boolean,
|
|
|
|
viewportSize?: { width: number, height: number },
|
2021-01-28 21:50:57 +03:00
|
|
|
debugName?: string,
|
2020-08-28 20:51:55 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export type ContextDestroyedTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-08-28 20:51:55 +03:00
|
|
|
type: 'context-destroyed',
|
|
|
|
contextId: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type NetworkResourceTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-08-28 20:51:55 +03:00
|
|
|
type: 'resource',
|
|
|
|
contextId: string,
|
2020-09-14 17:56:04 +03:00
|
|
|
pageId: string,
|
2020-08-28 20:51:55 +03:00
|
|
|
frameId: string,
|
2021-01-28 06:42:51 +03:00
|
|
|
resourceId: string,
|
2020-08-28 20:51:55 +03:00
|
|
|
url: string,
|
|
|
|
contentType: string,
|
|
|
|
responseHeaders: { name: string, value: string }[],
|
2021-01-26 22:06:05 +03:00
|
|
|
requestHeaders: { name: string, value: string }[],
|
|
|
|
method: string,
|
|
|
|
status: number,
|
|
|
|
requestSha1: string,
|
|
|
|
responseSha1: string,
|
2020-08-28 20:51:55 +03:00
|
|
|
};
|
|
|
|
|
2020-09-11 21:34:53 +03:00
|
|
|
export type PageCreatedTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-09-11 21:34:53 +03:00
|
|
|
type: 'page-created',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type PageDestroyedTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-09-11 21:34:53 +03:00
|
|
|
type: 'page-destroyed',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
2020-09-19 03:36:43 +03:00
|
|
|
export type PageVideoTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-09-19 03:36:43 +03:00
|
|
|
type: 'page-video',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
fileName: string,
|
|
|
|
};
|
|
|
|
|
2020-09-11 07:42:09 +03:00
|
|
|
export type ActionTraceEvent = {
|
2021-01-16 05:30:55 +03:00
|
|
|
timestamp: number,
|
2020-09-11 07:42:09 +03:00
|
|
|
type: 'action',
|
2020-08-28 20:51:55 +03:00
|
|
|
contextId: string,
|
2020-09-11 07:42:09 +03:00
|
|
|
action: string,
|
2020-09-11 21:34:53 +03:00
|
|
|
pageId?: string,
|
2020-09-17 01:26:59 +03:00
|
|
|
selector?: string,
|
2020-09-11 07:42:09 +03:00
|
|
|
label?: string,
|
|
|
|
value?: string,
|
2021-01-16 05:30:55 +03:00
|
|
|
startTime: number,
|
|
|
|
endTime: number,
|
2020-09-11 07:42:09 +03:00
|
|
|
logs?: string[],
|
|
|
|
stack?: string,
|
|
|
|
error?: string,
|
2021-01-26 05:44:46 +03:00
|
|
|
snapshots?: { name: string, snapshotId: string }[],
|
2020-08-28 20:51:55 +03:00
|
|
|
};
|
2020-09-18 21:54:00 +03:00
|
|
|
|
2021-01-16 05:30:55 +03:00
|
|
|
export type DialogOpenedEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'dialog-opened',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
dialogType: string,
|
|
|
|
message?: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type DialogClosedEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'dialog-closed',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
dialogType: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type NavigationEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'navigation',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
url: string,
|
|
|
|
sameDocument: boolean,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type LoadEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'load',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
2021-01-26 05:44:46 +03:00
|
|
|
export type FrameSnapshotTraceEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'snapshot',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
frameId: string, // Empty means main frame.
|
2021-01-28 06:42:51 +03:00
|
|
|
snapshot: FrameSnapshot,
|
2021-01-26 05:44:46 +03:00
|
|
|
frameUrl: string,
|
|
|
|
snapshotId?: string,
|
|
|
|
};
|
|
|
|
|
2020-09-18 21:54:00 +03:00
|
|
|
export type TraceEvent =
|
|
|
|
ContextCreatedTraceEvent |
|
|
|
|
ContextDestroyedTraceEvent |
|
|
|
|
PageCreatedTraceEvent |
|
|
|
|
PageDestroyedTraceEvent |
|
2020-09-19 03:36:43 +03:00
|
|
|
PageVideoTraceEvent |
|
2020-09-18 21:54:00 +03:00
|
|
|
NetworkResourceTraceEvent |
|
2021-01-16 05:30:55 +03:00
|
|
|
ActionTraceEvent |
|
|
|
|
DialogOpenedEvent |
|
|
|
|
DialogClosedEvent |
|
|
|
|
NavigationEvent |
|
2021-01-26 05:44:46 +03:00
|
|
|
LoadEvent |
|
|
|
|
FrameSnapshotTraceEvent;
|
2020-09-18 21:54:00 +03:00
|
|
|
|
|
|
|
|
|
|
|
export type FrameSnapshot = {
|
|
|
|
html: string,
|
|
|
|
resourceOverrides: { url: string, sha1: string }[],
|
2021-01-26 05:44:46 +03:00
|
|
|
viewport: { width: number, height: number },
|
2020-09-18 21:54:00 +03:00
|
|
|
};
|