Honor configured browser engine

This commit is contained in:
2026-08-05 21:11:17 +02:00
parent 1f5ab5a8cc
commit 6a1568a1dd
2 changed files with 2 additions and 7 deletions
+1
View File
@@ -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.
+1 -7
View File
@@ -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) {