Skip to content

Instantly share code, notes, and snippets.

@ThePsyjo
Created September 23, 2022 08:13
Show Gist options
  • Save ThePsyjo/f3ba57b3e1641f3af087c586840c7586 to your computer and use it in GitHub Desktop.
Save ThePsyjo/f3ba57b3e1641f3af087c586840c7586 to your computer and use it in GitHub Desktop.
this prevents LMB click on URL bar (if it wasn't already focused) from getting the equivalent of Ctrl+A aka Select All ie. it acts as if browser.urlbar.clickSelectsAll=false AND browser.urlbar.doubleClickSelectsAll=false so only triple click will Select All. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1621570 or https://bugzilla.mozilla.or…
diff -r 078326f48100 browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarInput.sys.mjs Tue Apr 14 06:41:42 2020 +0000
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs Tue Apr 14 16:01:40 2020 +0200
@@ -3101,6 +3101,8 @@
if (event.target.id == SEARCH_BUTTON_ID) {
this._preventClickSelectsAll = true;
this.search(lazy.UrlbarTokenizer.RESTRICT.SEARCH);
+ } else if (event.target == this.inputField) {
+ this._preventClickSelectsAll = true;
} else {
// Do not suppress the focus border if we are already focused. If we
// did, we'd hide the focus border briefly then show it again if the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment