diff options
author | sameerasw <[email protected]> | 2025-03-09 11:03:16 +0530 |
---|---|---|
committer | sameerasw <[email protected]> | 2025-03-09 11:03:16 +0530 |
commit | 3b82a39370022f5cc80be026bbd4606d116f6476 (patch) | |
tree | b34007510b7146a92cf3a540554d192b672d9366 /popup | |
parent | 46f443bdf404b5f5b81fa59899e271cb356e0598 (diff) |
Added reset addon storage option
Diffstat (limited to 'popup')
-rw-r--r-- | popup/popup.js | 16 |
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 + }); + } + } + } })(); |