MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / importPlaywright

Function importPlaywright

src/tools/browser/session.ts:75–87  ·  view source on GitHub ↗

* Lazily import playwright. Throws a clear error if not installed.

()

Source from the content-addressed store, hash-verified

73 * Lazily import playwright. Throws a clear error if not installed.
74 */
75async function importPlaywright(): Promise<typeof import('playwright')> {
76 try {
77 // @ts-ignore — optional dep, may not be installed
78 return await import('playwright');
79 } catch (e: any) {
80 throw new Error(
81 'playwright is not installed. Run:\n' +
82 ' npm install playwright\n' +
83 ' npx playwright install chromium\n' +
84 '(playwright is an optional dependency to keep base install small)',
85 );
86 }
87}
88
89/**
90 * Get the active session, launching the browser if needed.

Callers 2

getSessionFunction · 0.85
isPlaywrightAvailableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected