feat(ci): add husky pre-commit hook and fix puppeteer-core chrome detection

This commit is contained in:
2025-11-22 13:37:39 +01:00
parent 21d748b316
commit 81b2fd3cd3
12 changed files with 41 additions and 30 deletions

View File

@@ -124,11 +124,19 @@ export class BrowserDevToolsAdapter implements IBrowserAutomation {
'--no-sandbox',
];
this.browser = await puppeteer.launch({
const launchOptions: Parameters<typeof puppeteer.launch>[0] = {
headless: this.config.headless,
executablePath: this.config.executablePath || undefined,
args: launchArgs,
});
};
// Use explicit executablePath if provided, otherwise use channel to auto-detect Chrome
if (this.config.executablePath) {
launchOptions.executablePath = this.config.executablePath;
} else {
launchOptions.channel = 'chrome';
}
this.browser = await puppeteer.launch(launchOptions);
const pages = await this.browser.pages();
this.page = pages[0] || await this.browser.newPage();