We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 136da6a commit 0878319Copy full SHA for 0878319
1 file changed
src/third_party/index.ts
@@ -57,6 +57,14 @@ import {
57
generateReport as generateReportImpl,
58
} from './lighthouse-devtools-mcp-bundle.js';
59
60
+// Some vendored DevTools/Lighthouse code paths call window.atob/window.btoa even
61
+// when running under Node.js. Expose a browser-like alias so those runtime calls
62
+// resolve to Node's global atob/btoa instead of throwing ReferenceError.
63
+if (typeof globalThis.window === 'undefined') {
64
+ globalThis.window = globalThis as typeof globalThis & Window & typeof globalThis;
65
+}
66
+
67
68
export const snapshot = snapshotImpl as (
69
page: Page,
70
options: {flags?: Flags},
0 commit comments