From a554c0c3492f2e7ec7aa4337dd374f856d00af8d Mon Sep 17 00:00:00 2001 From: perazay Date: Tue, 3 Jun 2025 23:04:58 -0700 Subject: [PATCH] Bug 1968380 - Add confirmation or undo option for clearing cookies in Privacy settings r?perazay --- browser/components/preferences/privacy.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js index ceea471c9d9bcf..5083eaf3a20ea2 100644 --- a/browser/components/preferences/privacy.js +++ b/browser/components/preferences/privacy.js @@ -2562,6 +2562,18 @@ var gPrivacyPane = { }, clearSiteData() { + // Ask for confirmation first + let confirmed = Services.prompt.confirmEx( + window, + "Confirm Data Deletion", + "Are you sure you want to delete cookies and site data? This may sign you out of websites.", + Services.prompt.STD_YES_NO_BUTTONS, + null, null, null, null, {} + ); + + if (confirmed !== 0) { + return; + } // We have to use the full path name to avoid getting errors in // browser/base/content/test/static/browser_all_files_referenced.js let dialogFile = useOldClearHistoryDialog