| |

IV. Clear Data Dialog Cleanup

Cleanup patch removing dead code after the new dialog shipped.

Bug 1856418 | D271909 | Reviewer: manuel


The Change

The old clear history dialog (sanitize.xhtml) and the preference privacy.sanitize.useOldClearHistoryDialog have been fully removed. The new dialog (sanitize_v2.xhtml) is now the only option.


Removed

UI Files:

  • sanitize.xhtml
  • clearSiteData.xhtml
  • sanitize.js
  • clearSiteData.js

Tests:

  • browser_sanitizeDialog.js
  • test_Sanitizer_interrupted.js
  • Other old dialog test files

Preferences:

  • privacy.sanitize.useOldClearHistoryDialog from StaticPrefList.yaml and firefox.js

Updated

  • sanitizeDialog.js and Sanitizer.sys.mjs โ€” removed conditional branches
  • privacy.js โ€” removed old dialog selection logic
  • CacheObserver.h โ€” removed C++ preference check
  • Test files โ€” removed old dialog preference settings
  • Test manifests โ€” removed old test entries
  • jar.mn โ€” removed old dialog files from packaging

What I Learned

  1. Cleanup patches require thoroughness โ€” Every reference must be found: prefs, tests, localization, conditionals
  2. Always run lint before committing โ€” ./mach lint --warnings --outgoing catches accidental file inclusions
  3. Legacy code accumulates โ€” Every feature flag eventually becomes tech debt; regular cleanup keeps the codebase maintainable