- safeStorage is already defined in storage-utils.js which loads first
- Duplicate declaration was causing 'Identifier already declared' error
- This error prevented script.js from loading and broke theme toggle
- Added detailed console logs to track theme toggle initialization
- Logs will help identify why button doesn't work on non-fg_scan pages
- Temporary debug code to be removed after fix
- Fixed syntax error that prevented script.js from loading
- This was breaking the theme toggle button and all JavaScript functionality
- Removed extra }); on line 219
- Add guard clauses for reportTable, reportButtons, exportCsvButton, exportPdfButton
- Prevents JavaScript errors when report elements don't exist on page
- Ensures theme toggle and other functionality work on all pages
- Wraps report-specific code in null checks to avoid breaking other features
- Created storage-utils.js with safeStorage wrapper to prevent tracking prevention errors
- Updated script.js to use safeStorage for theme persistence
- Added conditional QZ Tray connection based on 'Enable Scan to Boxes' toggle
- Fixed 404 error by removing non-existent /api/backup/path endpoint call
- Enhanced fg_scan.html to disable QZ Tray and socket connections when toggle is off
- Prevents console errors when browser tracking prevention blocks localStorage access