From 58f92a35dc6eace6b58f095678a684c886da91b3 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 23 Dec 2024 00:03:20 +0530 Subject: [PATCH] feat: try-catch handling for adblocker in core --- maxun-core/src/interpret.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index bc99c92f..c581954d 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -670,7 +670,11 @@ export default class Interpreter extends EventEmitter { const workflowCopy: Workflow = JSON.parse(JSON.stringify(workflow)); // apply ad-blocker to the current page - await this.applyAdBlocker(p); + try { + await this.applyAdBlocker(p); + } catch (error) { + this.log(`Failed to apply ad-blocker: ${error.message}`, Level.ERROR); + } const usedActions: string[] = []; let selectors: string[] = []; let lastAction = null;