playwright-core1.65.13.5 MB
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.
wss.on("connection", (ws4, request2) => {
const url3 = new URL(request2.url ?? "/", "http://localhost");
const transport = transportFactory(url3);
transport.sendEvent = (method2, params2) => ws4.send(JSON.stringify({ method: method2, params: params2 }));
transport.close = () => ws4.close();
transport.onconnect();
ws4.on("message", async (message) => {
const { id, method: method2, params: params2 } = JSON.parse(String(message));
try {
const result2 = await transport.dispatch(method2, params2);
ws4.send(JSON.stringify({ id, result: result2 }));
} catch (e) {
ws4.send(JSON.stringify({ id, error: String(e) }));
}
});
ws4.on("close", () => transport.onclose());
ws4.on("error", () => transport.onclose());
});
}
async createViteDevServer(options) {
const loadVite = new Function('return import("vite")');
const vite = await loadVite();
return await vite.createServer({
root: options.root,
base: this._pathPrefix + (options.base ?? "/"),
plugins: [{
name: "playwright-path-prefix",
// Route handlers get URLs without the path prefix, but Vite needs the URL that the browser requested.
configureServer: (server) => {
server.middlewares.use((request2, _, next) => {
request2.url = this._pathPrefix + request2.url;
next();
});
}
}],
server: {
middlewareMode: true,
// Dedicated path so Vite's HMR websocket does not collide with any
// websocket HttpServer owns via createWebSocket().
hmr: { path: "/__vite_hmr", server: this._server }
},
This file is 3.5 MB, over the 1.0 MB the full view shows, so apm shows the lines around the cited one. Lines longer than 4 kB are cut.