Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/third_party/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ import {
generateReport as generateReportImpl,
} from './lighthouse-devtools-mcp-bundle.js';

// Some vendored DevTools/Lighthouse code paths call window.atob/window.btoa even
// when running under Node.js. Expose a browser-like alias so those runtime calls
// resolve to Node's global atob/btoa instead of throwing ReferenceError.
if (typeof globalThis.window === 'undefined') {
globalThis.window = globalThis as typeof globalThis & Window & typeof globalThis;
}


export const snapshot = snapshotImpl as (
page: Page,
options: {flags?: Flags},
Expand Down
Loading