From 499d12ece8128c4a78ff00b247799ae97dea2ae8 Mon Sep 17 00:00:00 2001 From: David Lyon Date: Fri, 15 Aug 2025 13:13:09 -0700 Subject: [PATCH] Add alert suppression to narrativeConfig.js --- kbase-extension/static/kbase/js/narrativeConfig.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kbase-extension/static/kbase/js/narrativeConfig.js b/kbase-extension/static/kbase/js/narrativeConfig.js index 1f89dc8739..64afcb0f0e 100644 --- a/kbase-extension/static/kbase/js/narrativeConfig.js +++ b/kbase-extension/static/kbase/js/narrativeConfig.js @@ -9,6 +9,17 @@ define([ ], ($, Promise, ConfigSet, IconsSet, ServiceSet, FeatureSet, StagingUpload) => { 'use strict'; + // Override window.alert to suppress alerts and log them with stack traces + function suppressAlerts() { + const originalAlert = window.alert; + window.alert = function(message) { + const error = new Error(`Alert suppressed: ${message}`); + console.error('KBase Narrative: window.alert() call suppressed. Alert content:', message, '\nStack trace:', error.stack); + }; + } + + suppressAlerts(); + /** * Loads the required narrative configuration files. * This returns a Promise that will eventually hold the results.