playwright-core 1.57.0-alpha-2025-10-28 → 1.57.0-alpha-2025-10-30

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.
@@ -0,0 +1 @@
1
+ .drop-target{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;line-height:24px}body .drop-target{background:#fffc}:root.dark-mode .drop-target{background:#000c}.drop-target .title{font-size:24px;font-weight:700;margin-bottom:30px}.drop-target .info{max-width:400px;text-align:center}.drop-target .processing-error{font-size:24px;color:#e74c3c;font-weight:700;text-align:center;margin:30px}.drop-target input{margin-top:50px}.drop-target button{color:#fff;background-color:#007acc;padding:8px 12px;border:none;margin:30px 0;cursor:pointer}.drop-target .version{color:var(--vscode-disabledForeground);margin-top:8px}.progress-dialog{width:400px;top:0;right:0;bottom:0;left:0;border:none;outline:none;background-color:var(--vscode-sideBar-background)}.progress-dialog::backdrop{background-color:#0006}.progress-content{padding:16px}.progress-content .title{background-color:unset;font-size:18px;font-weight:700;padding:0}.progress-wrapper{background-color:var(--vscode-commandCenter-activeBackground);width:100%;margin-top:16px;margin-bottom:8px}.inner-progress{background-color:var(--vscode-progressBar-background);height:4px}.header{display:flex;background-color:#000;flex:none;flex-basis:48px;line-height:48px;font-size:16px;color:#ccc}.workbench-loader{contain:size}.workbench-loader .header .toolbar-button{margin:12px;padding:8px 4px}.workbench-loader .logo{margin-left:16px;display:flex;align-items:center}.workbench-loader .logo img{height:32px;width:32px;pointer-events:none;flex:none}.workbench-loader .product{font-weight:600;margin-left:16px;flex:none}.workbench-loader .header .title{margin-left:16px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}html,body{min-width:550px;min-height:450px;overflow:auto}
@@ -0,0 +1,2 @@
1
+ import{M as m,r,T as M,W as C,j as e,D as F,a as I,b as k,c as z,d as O,e as V}from"./assets/defaultSettingsView-B24Q0BeR.js";const $=()=>{const[o,i]=r.useState(!1),[c,l]=r.useState(),[h,u]=r.useState(),[g,L]=r.useState(N),[p,x]=r.useState({done:0,total:0}),[b,v]=r.useState(!1),[j,S]=r.useState(null),[y,P]=r.useState(null),[R,E]=r.useState(!1),w=r.useCallback(t=>{const s=new URL(window.location.href);if(!t.length)return;const n=t.item(0),a=URL.createObjectURL(n);s.searchParams.append("trace",a);const d=s.toString();window.history.pushState({},"",d),l(a),u(n.name),v(!1),S(null)},[]);r.useEffect(()=>{const t=async s=>{var n;if((n=s.clipboardData)!=null&&n.files.length){for(const a of s.clipboardData.files)if(a.type!=="application/zip")return;s.preventDefault(),w(s.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),r.useEffect(()=>{const t=s=>{const{method:n,params:a}=s.data;if(n!=="load"||!((a==null?void 0:a.trace)instanceof Blob))return;const d=new File([a.trace],"trace.zip",{type:"application/zip"}),f=new DataTransfer;f.items.add(d),w(f.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const U=r.useCallback(t=>{t.preventDefault(),w(t.dataTransfer.files)},[w]),W=r.useCallback(t=>{t.preventDefault(),t.target.files&&w(t.target.files)},[w]);r.useEffect(()=>{const t=new URL(window.location.href).searchParams,s=t.get("trace");if(i(t.has("isServer")),s!=null&&s.startsWith("file:")){P(s||null);return}if(t.has("isServer")){const n=new URLSearchParams(window.location.search).get("ws"),a=new URL(`../${n}`,window.location.toString());a.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new M(new C(a));d.onLoadTraceRequested(async f=>{l(f.traceUrl),v(!1),S(null)}),d.initialize({}).catch(()=>{})}else s&&!s.startsWith("blob:")&&l(s)},[]),r.useEffect(()=>{(async()=>{if(!c){L(N);return}const t=s=>{s.data.method==="progress"&&x(s.data.params)};try{navigator.serviceWorker.addEventListener("message",t),x({done:0,total:1});const s=new URLSearchParams;s.set("trace",c);const n=await fetch(`contexts?${s.toString()}`);if(!n.ok){o||l(void 0),S((await n.json()).error);return}const a=await n.json(),d=new m(c,a);x({done:0,total:0}),L(d)}finally{navigator.serviceWorker.removeEventListener("message",t)}})()},[o,c,h]);const D=p.done!==p.total&&p.total!==0&&!j;r.useEffect(()=>{if(D){const t=setTimeout(()=>{E(!0)},200);return()=>clearTimeout(t)}else E(!1)},[D]);const T=!!(!o&&!b&&!y&&(!c||j));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),v(!0)},children:[e.jsxs("div",{className:"hbox header",...T?{inert:!0}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),g.title&&e.jsx("div",{className:"title",children:g.title}),e.jsx("div",{className:"spacer"}),e.jsx(F,{icon:"settings-gear",title:"Settings",dialogDataTestId:"settings-toolbar-dialog",children:e.jsx(I,{})})]}),e.jsx(k,{model:g,inert:T}),y&&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:y,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"})]})]}),e.jsx(z,{open:R,isModal:!0,className:"progress-dialog",children:e.jsxs("div",{className:"progress-content",children:[e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Loading Playwright Trace..."}),e.jsx("div",{className:"progress-wrapper",children:e.jsx("div",{className:"inner-progress",style:{width:p.total?100*p.done/p.total+"%":0}})})]})}),T&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:j}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.click(),t.addEventListener("change",s=>W(s))},type:"button",children:"Select file"}),e.jsx("div",{className:"info",children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."}),e.jsxs("div",{className:"version",children:["Playwright v","1.57.0-next"]})]}),o&&!c&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),b&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{v(!1)},onDrop:t=>U(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new m("",[]),q=({traceJson:o})=>{const[i,c]=r.useState(void 0),[l,h]=r.useState(0),u=r.useRef(null);return r.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const g=await A(o);c(g)}catch{const g=new m("",[]);c(g)}finally{h(l+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[o,l]),e.jsx(k,{isLive:!0,model:i})};async function A(o){const i=new URLSearchParams;i.set("trace",o);const l=await(await fetch(`contexts?${i.toString()}`)).json();return new m(o,l)}(async()=>{const o=new URLSearchParams(window.location.search);if(O(),window.location.protocol!=="file:"){if(o.get("isUnderTest")==="true"&&await new Promise(h=>setTimeout(h,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(h=>{navigator.serviceWorker.oncontrollerchange=()=>h()}),setInterval(function(){fetch("ping")},1e4)}const i=o.get("trace"),l=(i==null?void 0:i.endsWith(".json"))?e.jsx(q,{traceJson:i}):e.jsx($,{});V.createRoot(document.querySelector("#root")).render(l)})();
@@ -7,10 +7,10 @@
7
7
  <link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
8
8
  <link rel="manifest" href="./manifest.webmanifest">
9
9
  <title>Playwright Trace Viewer</title>
10
- <script type="module" crossorigin src="./index.3DfaPcDQ.js"></script>
10
+ <script type="module" crossorigin src="./index.DY0nr6ME.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-B24Q0BeR.js">
12
12
  <link rel="stylesheet" crossorigin href="./defaultSettingsView.BEjzWGz-.css">
13
- <link rel="stylesheet" crossorigin href="./index.I8N9v4jT.css">
13
+ <link rel="stylesheet" crossorigin href="./index.C4Y3Aw8n.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-core",
3
- "version": "1.57.0-alpha-2025-10-28",
3
+ "version": "1.57.0-alpha-2025-10-30",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_net = __toESM(require("net"));
25
- var import_fs = __toESM(require("fs"));
26
- var import_child_process = require("child_process");
27
- (async () => {
28
- const { PW_WSL_BRIDGE_PORT: socketPort, ...childEnv } = process.env;
29
- if (!socketPort)
30
- throw new Error("PW_WSL_BRIDGE_PORT env var is not set");
31
- const [executable, ...args] = process.argv.slice(2);
32
- if (!(await import_fs.default.promises.stat(executable)).isFile())
33
- throw new Error(`Executable does not exist. Did you update Playwright recently? Make sure to run npx playwright install webkit-wsl`);
34
- const address = (() => {
35
- const res = (0, import_child_process.spawnSync)("/usr/bin/wslinfo", ["--networking-mode"], { encoding: "utf8" });
36
- if (res.error || res.status !== 0)
37
- throw new Error(`Failed to run /usr/bin/wslinfo --networking-mode: ${res.error?.message || res.stderr || res.status}`);
38
- if (res.stdout.trim() === "nat") {
39
- const ipRes = (0, import_child_process.spawnSync)("/usr/sbin/ip", ["route", "show"], { encoding: "utf8" });
40
- if (ipRes.error || ipRes.status !== 0)
41
- throw new Error(`Failed to run ip route show: ${ipRes.error?.message || ipRes.stderr || ipRes.status}`);
42
- const ip = ipRes.stdout.trim().split("\n").find((line) => line.includes("default"))?.split(" ")[2];
43
- if (!ip)
44
- throw new Error("Could not determine WSL IP address (NAT mode).");
45
- return ip;
46
- }
47
- return "127.0.0.1";
48
- })();
49
- const socket = import_net.default.createConnection(parseInt(socketPort, 10), address);
50
- socket.setNoDelay(true);
51
- await new Promise((resolve, reject) => {
52
- socket.on("connect", resolve);
53
- socket.on("error", reject);
54
- });
55
- const child = (0, import_child_process.spawn)(executable, args, {
56
- stdio: ["inherit", "inherit", "inherit", "pipe", "pipe"],
57
- env: childEnv
58
- });
59
- const [childOutput, childInput] = [child.stdio[3], child.stdio[4]];
60
- socket.pipe(childOutput);
61
- childInput.pipe(socket);
62
- socket.on("end", () => child.kill());
63
- child.on("exit", (exitCode) => {
64
- socket.end();
65
- process.exit(exitCode || 0);
66
- });
67
- await new Promise((resolve, reject) => {
68
- child.on("exit", resolve);
69
- child.on("error", reject);
70
- });
71
- })().catch((error) => {
72
- console.error("Error occurred:", error);
73
- process.exit(1);
74
- });
@@ -1,113 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_net = __toESM(require("net"));
25
- var import_path = __toESM(require("path"));
26
- var import_child_process = require("child_process");
27
- (async () => {
28
- const argv = process.argv.slice(2);
29
- if (!argv.length) {
30
- console.error(`Usage: node ${import_path.default.basename(__filename)} <executable> [args...]`);
31
- process.exit(1);
32
- }
33
- const parentIn = new import_net.default.Socket({ fd: 3, readable: true, writable: false });
34
- const parentOut = new import_net.default.Socket({ fd: 4, readable: false, writable: true });
35
- const server = import_net.default.createServer();
36
- let socket = null;
37
- server.on("connection", (s) => {
38
- if (socket) {
39
- log("Extra connection received, destroying.");
40
- socket.destroy();
41
- return;
42
- }
43
- socket = s;
44
- socket.setNoDelay(true);
45
- log("Client connected, wiring pipes.");
46
- socket.pipe(parentOut);
47
- parentIn.pipe(socket);
48
- socket.on("close", () => {
49
- log("Socket closed");
50
- socket = null;
51
- });
52
- });
53
- await new Promise((resolve, reject) => {
54
- server.once("error", reject);
55
- server.listen(0, () => resolve(null));
56
- });
57
- const address = server.address();
58
- if (!address || typeof address === "string") {
59
- console.error("Failed to obtain listening address");
60
- process.exit(1);
61
- }
62
- const port = address.port;
63
- log("Server listening on", port);
64
- const env = {
65
- ...process.env,
66
- // WSLENV is a colon-delimited list of environment variables that should be included when launching WSL processes from Win32 or Win32 processes from WSL
67
- WSLENV: "PW_WSL_BRIDGE_PORT",
68
- PW_WSL_BRIDGE_PORT: String(port)
69
- };
70
- let shuttingDown = false;
71
- const child = (0, import_child_process.spawn)("wsl.exe", [
72
- "-d",
73
- "playwright",
74
- "--cd",
75
- "/home/pwuser",
76
- "/home/pwuser/node/bin/node",
77
- "/home/pwuser/webkit-wsl-transport-client.js",
78
- process.env.WEBKIT_EXECUTABLE || "",
79
- ...argv
80
- ], {
81
- env,
82
- stdio: ["inherit", "inherit", "inherit"]
83
- // no fd3/fd4 here; they stay only in this wrapper
84
- });
85
- log("Spawned child pid", child.pid);
86
- child.on("close", (code, signal) => {
87
- log("Child exit", { code, signal });
88
- const exitCode = code ?? (signal ? 128 : 0);
89
- shutdown(exitCode);
90
- });
91
- child.on("error", (err) => {
92
- console.error("Child process failed to start:", err);
93
- shutdown(1);
94
- });
95
- await new Promise((resolve) => child.once("close", resolve));
96
- async function shutdown(code = 0) {
97
- if (shuttingDown)
98
- return;
99
- shuttingDown = true;
100
- server.close();
101
- parentIn.destroy();
102
- parentOut.destroy();
103
- socket?.destroy();
104
- await new Promise((resolve) => server.once("close", resolve));
105
- process.exit(code);
106
- }
107
- function log(...args) {
108
- console.error(/* @__PURE__ */ new Date(), `[${import_path.default.basename(__filename)}]`, ...args);
109
- }
110
- })().catch((error) => {
111
- console.error("Error occurred:", error);
112
- process.exit(1);
113
- });
@@ -1,2 +0,0 @@
1
- import{M as m,r as s,T as M,W as C,j as e,D as F,a as I,b as N,c as z,d as O,e as V}from"./assets/defaultSettingsView-B24Q0BeR.js";const $=()=>{const[o,i]=s.useState(!1),[c,l]=s.useState(),[h,u]=s.useState(),[p,L]=s.useState(k),[g,x]=s.useState({done:0,total:0}),[b,f]=s.useState(!1),[j,S]=s.useState(null),[y,P]=s.useState(null),[R,E]=s.useState(!1),w=s.useCallback(t=>{const r=new URL(window.location.href);if(!t.length)return;const n=t.item(0),a=URL.createObjectURL(n);r.searchParams.append("trace",a);const d=r.toString();window.history.pushState({},"",d),l(a),u(n.name),f(!1),S(null)},[]);s.useEffect(()=>{const t=async r=>{var n;if((n=r.clipboardData)!=null&&n.files.length){for(const a of r.clipboardData.files)if(a.type!=="application/zip")return;r.preventDefault(),w(r.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),s.useEffect(()=>{const t=r=>{const{method:n,params:a}=r.data;if(n!=="load"||!((a==null?void 0:a.trace)instanceof Blob))return;const d=new File([a.trace],"trace.zip",{type:"application/zip"}),v=new DataTransfer;v.items.add(d),w(v.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const U=s.useCallback(t=>{t.preventDefault(),w(t.dataTransfer.files)},[w]),W=s.useCallback(t=>{t.preventDefault(),t.target.files&&w(t.target.files)},[w]);s.useEffect(()=>{const t=new URL(window.location.href).searchParams,r=t.get("trace");if(i(t.has("isServer")),r!=null&&r.startsWith("file:")){P(r||null);return}if(t.has("isServer")){const n=new URLSearchParams(window.location.search).get("ws"),a=new URL(`../${n}`,window.location.toString());a.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new M(new C(a));d.onLoadTraceRequested(async v=>{l(v.traceUrl),f(!1),S(null)}),d.initialize({}).catch(()=>{})}else r&&!r.startsWith("blob:")&&l(r)},[]),s.useEffect(()=>{(async()=>{if(!c){L(k);return}const t=r=>{r.data.method==="progress"&&x(r.data.params)};try{navigator.serviceWorker.addEventListener("message",t),x({done:0,total:1});const r=new URLSearchParams;r.set("trace",c);const n=await fetch(`contexts?${r.toString()}`);if(!n.ok){o||l(void 0),S((await n.json()).error);return}const a=await n.json(),d=new m(c,a);x({done:0,total:0}),L(d)}finally{navigator.serviceWorker.removeEventListener("message",t)}})()},[o,c,h]);const D=g.done!==g.total&&g.total!==0&&!j;s.useEffect(()=>{if(D){const t=setTimeout(()=>{E(!0)},200);return()=>clearTimeout(t)}else E(!1)},[D]);const T=!!(!o&&!b&&!y&&(!c||j));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),f(!0)},children:[e.jsxs("div",{className:"hbox header",...T?{inert:!0}:{},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(F,{icon:"settings-gear",title:"Settings",dialogDataTestId:"settings-toolbar-dialog",children:e.jsx(I,{})})]}),e.jsx(N,{model:p,inert:T}),y&&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:y,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"})]})]}),e.jsx(z,{open:R,isModal:!0,className:"progress-dialog",children:e.jsxs("div",{className:"progress-content",children:[e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Loading Playwright Trace..."}),e.jsx("div",{className:"progress-wrapper",children:e.jsx("div",{className:"inner-progress",style:{width:g.total?100*g.done/g.total+"%":0}})})]})}),T&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:j}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.click(),t.addEventListener("change",r=>W(r))},type:"button",children:"Select file"}),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."})]}),o&&!c&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),b&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{f(!1)},onDrop:t=>U(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},k=new m("",[]),q=({traceJson:o})=>{const[i,c]=s.useState(void 0),[l,h]=s.useState(0),u=s.useRef(null);return s.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const p=await A(o);c(p)}catch{const p=new m("",[]);c(p)}finally{h(l+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[o,l]),e.jsx(N,{isLive:!0,model:i})};async function A(o){const i=new URLSearchParams;i.set("trace",o);const l=await(await fetch(`contexts?${i.toString()}`)).json();return new m(o,l)}(async()=>{const o=new URLSearchParams(window.location.search);if(O(),window.location.protocol!=="file:"){if(o.get("isUnderTest")==="true"&&await new Promise(h=>setTimeout(h,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(h=>{navigator.serviceWorker.oncontrollerchange=()=>h()}),setInterval(function(){fetch("ping")},1e4)}const i=o.get("trace"),l=(i==null?void 0:i.endsWith(".json"))?e.jsx(q,{traceJson:i}):e.jsx($,{});V.createRoot(document.querySelector("#root")).render(l)})();
@@ -1 +0,0 @@
1
- .drop-target{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;line-height:24px}body .drop-target{background:#fffc}:root.dark-mode .drop-target{background:#000c}.drop-target .title{font-size:24px;font-weight:700;margin-bottom:30px}.drop-target .processing-error{font-size:24px;color:#e74c3c;font-weight:700;text-align:center;margin:30px}.drop-target input{margin-top:50px}.drop-target button{color:#fff;background-color:#007acc;padding:8px 12px;border:none;margin:30px 0;cursor:pointer}.progress-dialog{width:400px;top:0;right:0;bottom:0;left:0;border:none;outline:none;background-color:var(--vscode-sideBar-background)}.progress-dialog::backdrop{background-color:#0006}.progress-content{padding:16px}.progress-content .title{background-color:unset;font-size:18px;font-weight:700;padding:0}.progress-wrapper{background-color:var(--vscode-commandCenter-activeBackground);width:100%;margin-top:16px;margin-bottom:8px}.inner-progress{background-color:var(--vscode-progressBar-background);height:4px}.header{display:flex;background-color:#000;flex:none;flex-basis:48px;line-height:48px;font-size:16px;color:#ccc}.workbench-loader{contain:size}.workbench-loader .header .toolbar-button{margin:12px;padding:8px 4px}.workbench-loader .logo{margin-left:16px;display:flex;align-items:center}.workbench-loader .logo img{height:32px;width:32px;pointer-events:none;flex:none}.workbench-loader .product{font-weight:600;margin-left:16px;flex:none}.workbench-loader .header .title{margin-left:16px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}html,body{min-width:550px;min-height:450px;overflow:auto}