diff --git a/agent.md b/agent.md index 34741d3..6500822 100644 --- a/agent.md +++ b/agent.md @@ -69,6 +69,7 @@ This project replaces the Excel/VBA workflow named `Catalog maker - 20` with a N - Use Playwright for all supplier/manufacturer website scraping and browser page inspection. - Do not implement new scraping with raw `fetch`, regex-only HTML parsing, Selenium or direct HTTP shortcuts. - Scrapers must use controlled browser navigation, selectors, explicit waits and bounded request counts. +- The configured browser engine for a source is authoritative. If a source says `firefox`, launch Firefox or fail loudly; do not silently fall back to Chromium, Edge or another browser. - Keep scraping slow and observable, preserve source URL/status information, and handle blocked pages or missing selectors as explicit errors. - Supplier data remains a local draft until the user explicitly confirms an Apply / Save action. diff --git a/src/services/browser-adapter.ts b/src/services/browser-adapter.ts index f79e21b..983580f 100644 --- a/src/services/browser-adapter.ts +++ b/src/services/browser-adapter.ts @@ -58,13 +58,7 @@ function launchBrowser(engine, headless) { ...(executablePath ? { executablePath } : {}), }; - return browserType.launch(options).catch((error) => { - if (normalizedEngine !== "firefox") throw error; - - const chromiumPath = resolveSystemBrowser("chromium"); - if (!chromiumPath) throw error; - return chromium.launch({ headless, timeout: 10_000, executablePath: chromiumPath }); - }); + return browserType.launch(options); } function resolveSystemBrowser(engine) {