From 72b22dad557e002845b9fbca7d0d2626d4b6d2d0 Mon Sep 17 00:00:00 2001 From: JakubMrozek Date: Mon, 30 Mar 2026 15:24:07 +0200 Subject: [PATCH 1/2] Suppress ERR_BLOCKED_BY_ORB noise from third-party ad creatives ERR_BLOCKED_BY_ORB errors are triggered by cross-origin resource requests from ad creatives that lack proper CORS headers. These are not actionable on our side and generate noise in logs/Sentry. Suppressed in both onConsoleMessage and onReceivedError callbacks. Fixes KON-1264 Co-Authored-By: Claude Sonnet 4.6 --- lib/src/widgets/kontext_webview.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/src/widgets/kontext_webview.dart b/lib/src/widgets/kontext_webview.dart index 9b5657fe..fb2f7afe 100644 --- a/lib/src/widgets/kontext_webview.dart +++ b/lib/src/widgets/kontext_webview.dart @@ -177,6 +177,12 @@ class KontextWebview extends HookWidget { switch (level) { case ConsoleMessageLevel.ERROR: + // ERR_BLOCKED_BY_ORB errors are caused by third-party ad creatives + // loading cross-origin resources without proper CORS headers. + // They are not actionable on our side, so we suppress them. + if (consoleMessage.message.contains('ERR_BLOCKED_BY_ORB')) { + return; + } _logError( webViewConsoleErrorLimiter, message: webViewMessage, @@ -190,6 +196,12 @@ class KontextWebview extends HookWidget { } }, onReceivedError: (controller, request, error) { + // ERR_BLOCKED_BY_ORB errors are caused by third-party ad creatives + // loading cross-origin resources without proper CORS headers. + // They are not actionable on our side, so we suppress them. + if (error.description.contains('ERR_BLOCKED_BY_ORB')) { + return; + } final webViewMessage = 'Error received in InAppWebView: $error, request: $request'; _logError( webViewConsoleErrorLimiter, From 87464deabc3de8a353079b6ef66c58210a9cf1e5 Mon Sep 17 00:00:00 2001 From: JakubMrozek Date: Mon, 30 Mar 2026 15:28:50 +0200 Subject: [PATCH 2/2] Remove incorrect ERR_BLOCKED_BY_ORB filter from onConsoleMessage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error code ERR_BLOCKED_BY_ORB appears in onReceivedError.description, not in console messages — Chrome logs a different string there. The filter in onConsoleMessage would never match. Co-Authored-By: Claude Sonnet 4.6 --- lib/src/widgets/kontext_webview.dart | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/src/widgets/kontext_webview.dart b/lib/src/widgets/kontext_webview.dart index fb2f7afe..3f41683b 100644 --- a/lib/src/widgets/kontext_webview.dart +++ b/lib/src/widgets/kontext_webview.dart @@ -177,12 +177,6 @@ class KontextWebview extends HookWidget { switch (level) { case ConsoleMessageLevel.ERROR: - // ERR_BLOCKED_BY_ORB errors are caused by third-party ad creatives - // loading cross-origin resources without proper CORS headers. - // They are not actionable on our side, so we suppress them. - if (consoleMessage.message.contains('ERR_BLOCKED_BY_ORB')) { - return; - } _logError( webViewConsoleErrorLimiter, message: webViewMessage,