Lines 47-87javascript
48 '--disable-web-security',
50// Force software WebGL for headless capture so local preview output stays stable.
51exports.HEADLESS_CHROMIUM_ARGS = [
52 ...COMMON_CHROMIUM_ARGS,
54 '--use-angle=swiftshader',
55 '--enable-unsafe-swiftshader',
56 '--ignore-gpu-blocklist',
58// Visible dev-browser sessions should use the normal GPU path instead of SwiftShader.
59exports.INTERACTIVE_CHROMIUM_ARGS = [
60 ...COMMON_CHROMIUM_ARGS,
61 '--ignore-gpu-blocklist',
63// Deterministic project checks must exercise the installed Chrome GPU path.
64exports.INSTALLED_CHROME_ARGS = exports.INTERACTIVE_CHROMIUM_ARGS;
65// Backward-compatible alias for older imports.
66exports.CHROMIUM_ARGS = exports.HEADLESS_CHROMIUM_ARGS;
67let customLoader = null;
68const nativeImport = new Function('specifier', 'return import(specifier);');
69function setPlaywrightLoader(loader) {
70 customLoader = loader;
72async function loadPlaywright() {
74 return customLoader();
76 const loaderPath = process.env.PLAYDROP_PLAYWRIGHT_LOADER_PATH?.trim();
78 const loaderModule = await nativeImport((0, node_url_1.pathToFileURL)(loaderPath).href);
79 const candidate = loaderModule.loadPlaywright
80 ?? loaderModule.createPlaywrightModule
81 ?? loaderModule.default
83 if (typeof candidate === 'function') {
84 return await candidate();
86 if (candidate && typeof candidate === 'object' && typeof candidate.chromium?.launch === 'function') {