From 8c2e3500bf8dc1bf4d25c3d289752b1623345aab Mon Sep 17 00:00:00 2001 From: Chuck Date: Thu, 8 Jan 2026 13:43:10 -0500 Subject: [PATCH] fix: Wrap debug console.log in debug flag check Fix unconditional debug logging that outputs internal implementation details to browser console for all users. Problem: - console.log('[ARRAY-OBJECTS] Functions defined on window:', ...) executes unconditionally when page loads - Outputs debug information about function availability to all users - Appears to be development/debugging code inadvertently included - Noisy console output in production Solution: - Wrap console.log statement in _PLUGIN_DEBUG_EARLY check to only output when pluginDebug localStorage flag is enabled - Matches pattern used elsewhere in the file for debug logging - Debug info now only visible when explicitly enabled via localStorage.setItem('pluginDebug', 'true') --- web_interface/static/v3/plugins_manager.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/web_interface/static/v3/plugins_manager.js b/web_interface/static/v3/plugins_manager.js index 0bd239cc..74b3e6a0 100644 --- a/web_interface/static/v3/plugins_manager.js +++ b/web_interface/static/v3/plugins_manager.js @@ -6671,13 +6671,16 @@ if (typeof window !== 'undefined') { window.updateArrayObjectData(fieldId); }; - console.log('[ARRAY-OBJECTS] Functions defined on window:', { - addArrayObjectItem: typeof window.addArrayObjectItem, - removeArrayObjectItem: typeof window.removeArrayObjectItem, - updateArrayObjectData: typeof window.updateArrayObjectData, - handleArrayObjectFileUpload: typeof window.handleArrayObjectFileUpload, - removeArrayObjectFile: typeof window.removeArrayObjectFile - }); + // Debug logging (only if pluginDebug is enabled) + if (_PLUGIN_DEBUG_EARLY) { + console.log('[ARRAY-OBJECTS] Functions defined on window:', { + addArrayObjectItem: typeof window.addArrayObjectItem, + removeArrayObjectItem: typeof window.removeArrayObjectItem, + updateArrayObjectData: typeof window.updateArrayObjectData, + handleArrayObjectFileUpload: typeof window.handleArrayObjectFileUpload, + removeArrayObjectFile: typeof window.removeArrayObjectFile + }); + } } // Make currentPluginConfig globally accessible (outside IIFE)