From 3b82a39370022f5cc80be026bbd4606d116f6476 Mon Sep 17 00:00:00 2001 From: sameerasw Date: Sun, 9 Mar 2025 11:03:16 +0530 Subject: Added reset addon storage option --- popup/popup.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'popup/popup.js') diff --git a/popup/popup.js b/popup/popup.js index 71ad967..a71eb4f 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -31,6 +31,10 @@ new (class ExtensionPopup { // Bind event listeners this.refetchCSSButton.addEventListener("click", this.refetchCSS.bind(this)); + this.refetchCSSButton.addEventListener( + "auxclick", + this.handleMiddleClick.bind(this) + ); this.autoUpdateSwitch.addEventListener( "change", this.saveSettings.bind(this) @@ -418,4 +422,16 @@ new (class ExtensionPopup { if (logging) console.log("reloadPage called"); browser.tabs.reload(); } + + handleMiddleClick(event) { + if (event.button === 1) { + // Middle click + if (confirm("Are you sure you want to clear all settings?")) { + browser.storage.local.clear().then(() => { + alert("All settings have been cleared."); + location.reload(); // Reload the popup to reflect changes + }); + } + } + } })(); -- cgit v1.2.3