@checkly/playwright-core 1.42.16 → 1.42.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/lib/vite/recorder/assets/{codeMirrorModule-LTVFY0Ab.js → codeMirrorModule-W69B4LBB.js} +14 -14
  2. package/lib/vite/recorder/assets/{index-wuONJPd7.js → index-Ly3PcVUb.js} +2 -2
  3. package/lib/vite/recorder/index.html +1 -1
  4. package/lib/vite/traceViewer/index.html +2 -2
  5. package/lib/vite/traceViewer/uiMode.html +2 -2
  6. package/package.json +1 -1
  7. package/lib/vite/traceViewer/assets/codeMirrorModule-BK3t1EEu.js +0 -24
  8. package/lib/vite/traceViewer/assets/codeMirrorModule-RVP_AMUu.js +0 -15585
  9. package/lib/vite/traceViewer/assets/codeMirrorModule-V7N6ppkd.js +0 -15585
  10. package/lib/vite/traceViewer/assets/codeMirrorModule-Vg1kIqMp.js +0 -24
  11. package/lib/vite/traceViewer/assets/codeMirrorModule-yboVpgC0.js +0 -15592
  12. package/lib/vite/traceViewer/assets/wsPort-1-6TL4lc.js +0 -18540
  13. package/lib/vite/traceViewer/assets/wsPort-964mA9MZ.js +0 -69
  14. package/lib/vite/traceViewer/assets/wsPort-CAXygIGt.js +0 -18540
  15. package/lib/vite/traceViewer/assets/wsPort-EUvw-dwH.js +0 -18540
  16. package/lib/vite/traceViewer/assets/wsPort-RIoVGhlT.js +0 -69
  17. package/lib/vite/traceViewer/assets/xtermModule-_6TC5FYT.js +0 -6529
  18. package/lib/vite/traceViewer/codeMirrorModule.svF_VrcJ.css +0 -344
  19. package/lib/vite/traceViewer/index.5mge2rY_.css +0 -124
  20. package/lib/vite/traceViewer/index.5nqVcfiC.js +0 -180
  21. package/lib/vite/traceViewer/index.6KJ-JQ0L.js +0 -180
  22. package/lib/vite/traceViewer/index.UNF4A0jZ.js +0 -180
  23. package/lib/vite/traceViewer/index.cbtHmFgM.js +0 -2
  24. package/lib/vite/traceViewer/index.qOFdH9Ja.js +0 -2
  25. package/lib/vite/traceViewer/uiMode.e-PLonGl.js +0 -1490
  26. package/lib/vite/traceViewer/uiMode.fEEgOxJh.js +0 -1490
  27. package/lib/vite/traceViewer/uiMode.fcU_T5Nf.js +0 -10
  28. package/lib/vite/traceViewer/uiMode.iNIhieBM.js +0 -10
  29. package/lib/vite/traceViewer/uiMode.iq7CyYy7.js +0 -1490
  30. package/lib/vite/traceViewer/uiMode.xvJHbkzl.css +0 -1324
  31. package/lib/vite/traceViewer/wsPort.p5jUwABW.css +0 -3450
  32. package/lib/vite/traceViewer/xtermModule.OKEVRlkP.css +0 -209
@@ -1,180 +0,0 @@
1
- import { M as MultiTraceModel, r as reactExports, c as connect, j as jsxRuntimeExports, T as ToolbarButton, t as toggleTheme, W as Workbench, a as applyTheme, b as reactDomExports } from "./assets/wsPort-EUvw-dwH.js";
2
- const WorkbenchLoader = () => {
3
- const [isServer, setIsServer] = reactExports.useState(false);
4
- const [traceURLs, setTraceURLs] = reactExports.useState([]);
5
- const [uploadedTraceNames, setUploadedTraceNames] = reactExports.useState([]);
6
- const [model, setModel] = reactExports.useState(emptyModel);
7
- const [progress, setProgress] = reactExports.useState({ done: 0, total: 0 });
8
- const [dragOver, setDragOver] = reactExports.useState(false);
9
- const [processingErrorMessage, setProcessingErrorMessage] = reactExports.useState(null);
10
- const [fileForLocalModeError, setFileForLocalModeError] = reactExports.useState(null);
11
- const processTraceFiles = reactExports.useCallback((files) => {
12
- const blobUrls = [];
13
- const fileNames = [];
14
- const url = new URL(window.location.href);
15
- for (let i = 0; i < files.length; i++) {
16
- const file = files.item(i);
17
- if (!file)
18
- continue;
19
- const blobTraceURL = URL.createObjectURL(file);
20
- blobUrls.push(blobTraceURL);
21
- fileNames.push(file.name);
22
- url.searchParams.append("trace", blobTraceURL);
23
- url.searchParams.append("traceFileName", file.name);
24
- }
25
- const href = url.toString();
26
- window.history.pushState({}, "", href);
27
- setTraceURLs(blobUrls);
28
- setUploadedTraceNames(fileNames);
29
- setDragOver(false);
30
- setProcessingErrorMessage(null);
31
- }, []);
32
- const handleDropEvent = reactExports.useCallback((event) => {
33
- event.preventDefault();
34
- processTraceFiles(event.dataTransfer.files);
35
- }, [processTraceFiles]);
36
- const handleFileInputChange = reactExports.useCallback((event) => {
37
- event.preventDefault();
38
- if (!event.target.files)
39
- return;
40
- processTraceFiles(event.target.files);
41
- }, [processTraceFiles]);
42
- reactExports.useEffect(() => {
43
- const params = new URL(window.location.href).searchParams;
44
- const newTraceURLs = params.getAll("trace");
45
- setIsServer(params.has("isServer"));
46
- for (const url of newTraceURLs) {
47
- if (url.startsWith("file:")) {
48
- setFileForLocalModeError(url || null);
49
- return;
50
- }
51
- }
52
- if (params.has("isServer")) {
53
- connect({
54
- onEvent(method, params2) {
55
- if (method === "loadTrace") {
56
- setTraceURLs(params2.url ? [params2.url] : []);
57
- setDragOver(false);
58
- setProcessingErrorMessage(null);
59
- }
60
- },
61
- onClose() {
62
- }
63
- }).then((sendMessage) => {
64
- sendMessage("ready");
65
- });
66
- } else if (!newTraceURLs.some((url) => url.startsWith("blob:"))) {
67
- setTraceURLs(newTraceURLs);
68
- }
69
- }, []);
70
- reactExports.useEffect(() => {
71
- (async () => {
72
- if (traceURLs.length) {
73
- const swListener = (event) => {
74
- if (event.data.method === "progress")
75
- setProgress(event.data.params);
76
- };
77
- navigator.serviceWorker.addEventListener("message", swListener);
78
- setProgress({ done: 0, total: 1 });
79
- const contextEntries = [];
80
- for (let i = 0; i < traceURLs.length; i++) {
81
- const url = traceURLs[i];
82
- const params = new URLSearchParams();
83
- params.set("trace", url);
84
- if (uploadedTraceNames.length)
85
- params.set("traceFileName", uploadedTraceNames[i]);
86
- const response = await fetch(`contexts?${params.toString()}`);
87
- if (!response.ok) {
88
- if (!isServer)
89
- setTraceURLs([]);
90
- setProcessingErrorMessage((await response.json()).error);
91
- return;
92
- }
93
- contextEntries.push(...await response.json());
94
- }
95
- navigator.serviceWorker.removeEventListener("message", swListener);
96
- const model2 = new MultiTraceModel(contextEntries);
97
- setProgress({ done: 0, total: 0 });
98
- setModel(model2);
99
- } else {
100
- setModel(emptyModel);
101
- }
102
- })();
103
- }, [isServer, traceURLs, uploadedTraceNames]);
104
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox workbench-loader", onDragOver: (event) => {
105
- event.preventDefault();
106
- setDragOver(true);
107
- }, children: [
108
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox header", children: [
109
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "logo", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "playwright-logo.svg", alt: "Playwright logo" }) }),
110
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "product", children: "Playwright" }),
111
- model.title && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: model.title }),
112
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "spacer" }),
113
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "color-mode", title: "Toggle color mode", toggled: false, onClick: () => toggleTheme() })
114
- ] }),
115
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "progress", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "inner-progress", style: { width: progress.total ? 100 * progress.done / progress.total + "%" : 0 } }) }),
116
- /* @__PURE__ */ jsxRuntimeExports.jsx(Workbench, { model }),
117
- fileForLocalModeError && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
118
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Trace Viewer uses Service Workers to show traces. To view trace:" }),
119
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { paddingTop: 20 }, children: [
120
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
121
- "1. Click ",
122
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: fileForLocalModeError, children: "here" }),
123
- " to put your trace into the download shelf"
124
- ] }),
125
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
126
- "2. Go to ",
127
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://trace.playwright.dev", children: "trace.playwright.dev" })
128
- ] }),
129
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "3. Drop the trace from the download shelf into the page" })
130
- ] })
131
- ] }),
132
- !isServer && !dragOver && !fileForLocalModeError && (!traceURLs.length || processingErrorMessage) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
133
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "processing-error", children: processingErrorMessage }),
134
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Drop Playwright Trace to load" }),
135
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "or" }),
136
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => {
137
- const input = document.createElement("input");
138
- input.type = "file";
139
- input.multiple = true;
140
- input.click();
141
- input.addEventListener("change", (e) => handleFileInputChange(e));
142
- }, children: "Select file(s)" }),
143
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: 400 }, children: "Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally." })
144
- ] }),
145
- isServer && !traceURLs.length && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "drop-target", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Select test to see the trace" }) }),
146
- dragOver && /* @__PURE__ */ jsxRuntimeExports.jsx(
147
- "div",
148
- {
149
- className: "drop-target",
150
- onDragLeave: () => {
151
- setDragOver(false);
152
- },
153
- onDrop: (event) => handleDropEvent(event),
154
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Release to analyse the Playwright Trace" })
155
- }
156
- )
157
- ] });
158
- };
159
- const emptyModel = new MultiTraceModel([]);
160
- (async () => {
161
- applyTheme();
162
- if (window.location.protocol !== "file:") {
163
- if (window.location.href.includes("isUnderTest=true"))
164
- await new Promise((f) => setTimeout(f, 1e3));
165
- if (!navigator.serviceWorker)
166
- throw new Error(`Service workers are not supported.
167
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
168
- navigator.serviceWorker.register("sw.bundle.js");
169
- if (!navigator.serviceWorker.controller) {
170
- await new Promise((f) => {
171
- navigator.serviceWorker.oncontrollerchange = () => f();
172
- });
173
- }
174
- setInterval(function() {
175
- fetch("ping");
176
- }, 1e4);
177
- }
178
- reactDomExports.render(/* @__PURE__ */ jsxRuntimeExports.jsx(WorkbenchLoader, {}), document.querySelector("#root"));
179
- })();
180
- //# sourceMappingURL=index.6KJ-JQ0L.js.map
@@ -1,180 +0,0 @@
1
- import { M as MultiTraceModel, r as reactExports, c as connect, j as jsxRuntimeExports, T as ToolbarButton, t as toggleTheme, W as Workbench, a as applyTheme, b as reactDomExports } from "./assets/wsPort-1-6TL4lc.js";
2
- const WorkbenchLoader = () => {
3
- const [isServer, setIsServer] = reactExports.useState(false);
4
- const [traceURLs, setTraceURLs] = reactExports.useState([]);
5
- const [uploadedTraceNames, setUploadedTraceNames] = reactExports.useState([]);
6
- const [model, setModel] = reactExports.useState(emptyModel);
7
- const [progress, setProgress] = reactExports.useState({ done: 0, total: 0 });
8
- const [dragOver, setDragOver] = reactExports.useState(false);
9
- const [processingErrorMessage, setProcessingErrorMessage] = reactExports.useState(null);
10
- const [fileForLocalModeError, setFileForLocalModeError] = reactExports.useState(null);
11
- const processTraceFiles = reactExports.useCallback((files) => {
12
- const blobUrls = [];
13
- const fileNames = [];
14
- const url = new URL(window.location.href);
15
- for (let i = 0; i < files.length; i++) {
16
- const file = files.item(i);
17
- if (!file)
18
- continue;
19
- const blobTraceURL = URL.createObjectURL(file);
20
- blobUrls.push(blobTraceURL);
21
- fileNames.push(file.name);
22
- url.searchParams.append("trace", blobTraceURL);
23
- url.searchParams.append("traceFileName", file.name);
24
- }
25
- const href = url.toString();
26
- window.history.pushState({}, "", href);
27
- setTraceURLs(blobUrls);
28
- setUploadedTraceNames(fileNames);
29
- setDragOver(false);
30
- setProcessingErrorMessage(null);
31
- }, []);
32
- const handleDropEvent = reactExports.useCallback((event) => {
33
- event.preventDefault();
34
- processTraceFiles(event.dataTransfer.files);
35
- }, [processTraceFiles]);
36
- const handleFileInputChange = reactExports.useCallback((event) => {
37
- event.preventDefault();
38
- if (!event.target.files)
39
- return;
40
- processTraceFiles(event.target.files);
41
- }, [processTraceFiles]);
42
- reactExports.useEffect(() => {
43
- const params = new URL(window.location.href).searchParams;
44
- const newTraceURLs = params.getAll("trace");
45
- setIsServer(params.has("isServer"));
46
- for (const url of newTraceURLs) {
47
- if (url.startsWith("file:")) {
48
- setFileForLocalModeError(url || null);
49
- return;
50
- }
51
- }
52
- if (params.has("isServer")) {
53
- connect({
54
- onEvent(method, params2) {
55
- if (method === "loadTrace") {
56
- setTraceURLs(params2.url ? [params2.url] : []);
57
- setDragOver(false);
58
- setProcessingErrorMessage(null);
59
- }
60
- },
61
- onClose() {
62
- }
63
- }).then((sendMessage) => {
64
- sendMessage("ready");
65
- });
66
- } else if (!newTraceURLs.some((url) => url.startsWith("blob:"))) {
67
- setTraceURLs(newTraceURLs);
68
- }
69
- }, []);
70
- reactExports.useEffect(() => {
71
- (async () => {
72
- if (traceURLs.length) {
73
- const swListener = (event) => {
74
- if (event.data.method === "progress")
75
- setProgress(event.data.params);
76
- };
77
- navigator.serviceWorker.addEventListener("message", swListener);
78
- setProgress({ done: 0, total: 1 });
79
- const contextEntries = [];
80
- for (let i = 0; i < traceURLs.length; i++) {
81
- const url = traceURLs[i];
82
- const params = new URLSearchParams();
83
- params.set("trace", url);
84
- if (uploadedTraceNames.length)
85
- params.set("traceFileName", uploadedTraceNames[i]);
86
- const response = await fetch(`contexts?${params.toString()}`);
87
- if (!response.ok) {
88
- if (!isServer)
89
- setTraceURLs([]);
90
- setProcessingErrorMessage((await response.json()).error);
91
- return;
92
- }
93
- contextEntries.push(...await response.json());
94
- }
95
- navigator.serviceWorker.removeEventListener("message", swListener);
96
- const model2 = new MultiTraceModel(contextEntries);
97
- setProgress({ done: 0, total: 0 });
98
- setModel(model2);
99
- } else {
100
- setModel(emptyModel);
101
- }
102
- })();
103
- }, [isServer, traceURLs, uploadedTraceNames]);
104
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox workbench-loader", onDragOver: (event) => {
105
- event.preventDefault();
106
- setDragOver(true);
107
- }, children: [
108
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox header", children: [
109
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "logo", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "playwright-logo.svg", alt: "Playwright logo" }) }),
110
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "product", children: "Playwright" }),
111
- model.title && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: model.title }),
112
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "spacer" }),
113
- /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "color-mode", title: "Toggle color mode", toggled: false, onClick: () => toggleTheme() })
114
- ] }),
115
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "progress", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "inner-progress", style: { width: progress.total ? 100 * progress.done / progress.total + "%" : 0 } }) }),
116
- /* @__PURE__ */ jsxRuntimeExports.jsx(Workbench, { model }),
117
- fileForLocalModeError && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
118
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Trace Viewer uses Service Workers to show traces. To view trace:" }),
119
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { paddingTop: 20 }, children: [
120
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
121
- "1. Click ",
122
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: fileForLocalModeError, children: "here" }),
123
- " to put your trace into the download shelf"
124
- ] }),
125
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
126
- "2. Go to ",
127
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://trace.playwright.dev", children: "trace.playwright.dev" })
128
- ] }),
129
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "3. Drop the trace from the download shelf into the page" })
130
- ] })
131
- ] }),
132
- !isServer && !dragOver && !fileForLocalModeError && (!traceURLs.length || processingErrorMessage) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
133
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "processing-error", children: processingErrorMessage }),
134
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Drop Playwright Trace to load" }),
135
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "or" }),
136
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => {
137
- const input = document.createElement("input");
138
- input.type = "file";
139
- input.multiple = true;
140
- input.click();
141
- input.addEventListener("change", (e) => handleFileInputChange(e));
142
- }, children: "Select file(s)" }),
143
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: 400 }, children: "Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally." })
144
- ] }),
145
- isServer && !traceURLs.length && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "drop-target", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Select test to see the trace" }) }),
146
- dragOver && /* @__PURE__ */ jsxRuntimeExports.jsx(
147
- "div",
148
- {
149
- className: "drop-target",
150
- onDragLeave: () => {
151
- setDragOver(false);
152
- },
153
- onDrop: (event) => handleDropEvent(event),
154
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Release to analyse the Playwright Trace" })
155
- }
156
- )
157
- ] });
158
- };
159
- const emptyModel = new MultiTraceModel([]);
160
- (async () => {
161
- applyTheme();
162
- if (window.location.protocol !== "file:") {
163
- if (window.location.href.includes("isUnderTest=true"))
164
- await new Promise((f) => setTimeout(f, 1e3));
165
- if (!navigator.serviceWorker)
166
- throw new Error(`Service workers are not supported.
167
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
168
- navigator.serviceWorker.register("sw.bundle.js");
169
- if (!navigator.serviceWorker.controller) {
170
- await new Promise((f) => {
171
- navigator.serviceWorker.oncontrollerchange = () => f();
172
- });
173
- }
174
- setInterval(function() {
175
- fetch("ping");
176
- }, 1e4);
177
- }
178
- reactDomExports.render(/* @__PURE__ */ jsxRuntimeExports.jsx(WorkbenchLoader, {}), document.querySelector("#root"));
179
- })();
180
- //# sourceMappingURL=index.UNF4A0jZ.js.map
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-964mA9MZ.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-RIoVGhlT.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();