summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
+ });
+ }
+ }
+ }
})();