summaryrefslogtreecommitdiff
path: root/popup/popup.js
diff options
context:
space:
mode:
authorsameerasw <[email protected]>2025-03-09 11:03:16 +0530
committersameerasw <[email protected]>2025-03-09 11:03:16 +0530
commit3b82a39370022f5cc80be026bbd4606d116f6476 (patch)
treeb34007510b7146a92cf3a540554d192b672d9366 /popup/popup.js
parent46f443bdf404b5f5b81fa59899e271cb356e0598 (diff)
Added reset addon storage option
Diffstat (limited to 'popup/popup.js')
-rw-r--r--popup/popup.js16
1 files changed, 16 insertions, 0 deletions
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
+ });
+ }
+ }
+ }
})();