Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: auto dismiss dialogs during crawling

Mohamed Bassem23ae17fa93e5
diff --git a/apps/workers/workers/crawlerWorker.ts b/apps/workers/workers/crawlerWorker.ts
index 8eaf5d50..0ca1beb8 100644
--- a/apps/workers/workers/crawlerWorker.ts
+++ b/apps/workers/workers/crawlerWorker.ts
@@ -544,6 +544,14 @@ async function crawlPage(
await globalBlocker.enableBlockingInPage(nextPage);
}
+ // Auto-dismiss JavaScript dialogs (alert, confirm, prompt)
+ // to prevent pages from hanging during crawl.
+ nextPage.on("dialog", (dialog) => {
+ dialog.dismiss().catch(() => {
+ // Ignore errors — the dialog may have already been closed.
+ });
+ });
+
// Block audio/video resources and disallowed sub-requests
await nextPage.route("**/*", async (route) => {
if (abortSignal.aborted) {