From f9f21d679c6c581adca495195c48a7284db85c91 Mon Sep 17 00:00:00 2001 From: detachhead Date: Wed, 2 Jul 2025 12:18:42 +1000 Subject: [PATCH] better fix for the playwright hanging issues --- src/node/main.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/node/main.ts b/src/node/main.ts index 91044af..c682ffe 100644 --- a/src/node/main.ts +++ b/src/node/main.ts @@ -7,18 +7,8 @@ export type SelectorEngine = Parameters[1] const selectorEngine = (fileName: string): SelectorEngine => ({ // https://github.com/microsoft/playwright/issues/36448 content: `(() => { - const useFakeModule = typeof module === 'undefined' - if (useFakeModule) { - window.module = {exports: {}}; - } - try { - ${readFileSync(join(__dirname, `../../dist/browser/${fileName}.js`), 'utf8')}; - return module.exports.default - } finally { - if (useFakeModule) { - delete module - } - } + const module = {exports: {}}; + ${readFileSync(join(__dirname, `../../dist/browser/${fileName}.js`), 'utf8')}; return module.exports.default })()`, })