From 6a1568a1dd30157d97fe74775b4114f6a8c4005c Mon Sep 17 00:00:00 2001 From: rajch_ales Date: Wed, 5 Aug 2026 21:11:17 +0200 Subject: [PATCH] Honor configured browser engine --- agent.md | 1 + src/services/browser-adapter.ts | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) 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) {