[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-102.9.0esr-12.0-1] 2 commits: fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Wed Apr 5 13:44:53 UTC 2023



Pier Angelo Vendrame pushed to branch tor-browser-102.9.0esr-12.0-1 at The Tor Project / Applications / Tor Browser


Commits:
2bbc0fe3 by Dan Ballard at 2023-04-05T15:44:25+02:00
fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

bug 41526: make tor connection cancel button grey

- - - - -
d36d67a8 by Dan Ballard at 2023-04-05T15:44:46+02:00
fixup! fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

Bug 41526: revert removal of focus to cancle button + add prevention
from keyboard input to trigger multiple buttons as focus switches

- - - - -


2 changed files:

- browser/components/torconnect/content/aboutTorConnect.css
- browser/components/torconnect/content/aboutTorConnect.js


Changes:

=====================================
browser/components/torconnect/content/aboutTorConnect.css
=====================================
@@ -136,6 +136,13 @@ button {
   fill: white;
 }
 
+#cancelButton {
+  color: var(--in-content-button-text-color);
+  border: 1px solid var(--in-content-button-border-color);
+  border-radius: 4px;
+  background-color: var(--in-content-button-background);
+}
+
 #locationDropdownLabel {
   margin-block: auto;
   margin-inline: 4px;


=====================================
browser/components/torconnect/content/aboutTorConnect.js
=====================================
@@ -775,6 +775,28 @@ class AboutTorConnect {
         this.beginAutoBootstrap(value);
       }
     });
+
+    // Delay the "Enter" activation of the given button from "keydown" to
+    // "keyup".
+    //
+    // Without this, holding down Enter will continue to trigger the button
+    // until the user stops holding. This means that a user can accidentally
+    // re-trigger a button several times. This is particularly bad when the
+    // focus gets moved to a new button, and the new button can get triggered
+    // immediately. E.g. when the "Connect" button is triggered it disappears
+    // and focus moves to the "Cancel" button.
+    for (const button of document.body.querySelectorAll("button")) {
+      button.addEventListener("keydown", event => {
+        if (event.key === "Enter") {
+          event.preventDefault();
+        }
+      });
+      button.addEventListener("keyup", event => {
+        if (event.key === "Enter") {
+          button.click();
+        }
+      });
+    }
   }
 
   initObservers() {



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/0553bfb9087f17d7b5c2063a719e6ad6de0d5435...d36d67a885509768015866abc9de1d3cd9ab2dd3

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/0553bfb9087f17d7b5c2063a719e6ad6de0d5435...d36d67a885509768015866abc9de1d3cd9ab2dd3
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230405/71b4d2fb/attachment-0001.htm>


More information about the tbb-commits mailing list