Open Bug 1750072 Opened 3 years ago Updated 2 years ago

Remove custom reveal/conceal button on password field

Categories

(Firefox :: about:logins, enhancement, P3)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: serg, Assigned: mtigley)

References

(Blocks 2 open bugs)

Details

(Keywords: leave-open, Whiteboard: [fxcm-productive-ux])

Attachments

(6 files)

Bug 1743046 will enable built-in reveal/conceal for password inputs.
We should remove custom implementation from about:logins.

Attached image double-reveal.png (deleted) —
Blocks: 1743046
Blocks: 1742338
Severity: -- → N/A
Priority: -- → P1

Hello Sergey Galich, I want to work upon this bug. I request you to kindly assign this bug to me.

Flags: needinfo?(sgalich)

Hello Ritika, this bug is harder than it looks. We still haven't decided what exactly we want to do with it - remove custom implementation in about:logins or disable new password reveal icon. We will either need reveal/conceal events from the <input type=password> (there are no such events today) or we will need to opt-out from new reveal button in input fields (which is also not possible today).

Flags: needinfo?(sgalich)
Priority: P1 → P2
Priority: P2 → P3
Blocks: 1706886
Assignee: nobody → mtigley
Status: NEW → ASSIGNED

The idea is that chrome code would be able to call preventDefault(),
then run whatever authentication they need to do, then setRevealPassword
again.

Hmm, I'm still unable to detect the "MozWillRevealPassword" event after its registered on the input element. Emilio, do you know why that might be the case?

Flags: needinfo?(emilio)

I think you need to listen to it from the privileged actor. Something like this seems to work:

diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
index 5333e10313866..ef10e10fde1b6 100644
--- a/browser/components/BrowserGlue.sys.mjs
+++ b/browser/components/BrowserGlue.sys.mjs
@@ -238,6 +238,7 @@ let JSWINDOWACTORS = {
         AboutLoginsSyncOptions: { wantUntrusted: true },
         AboutLoginsUpdateLogin: { wantUntrusted: true },
         AboutLoginsExportPasswords: { wantUntrusted: true },
+        MozWillRevealPassword: {},
       },
     },
     matches: ["about:logins", "about:logins?*", "about:loginsimportreport"],
diff --git a/browser/components/aboutlogins/AboutLoginsChild.sys.mjs b/browser/components/aboutlogins/AboutLoginsChild.sys.mjs
index c02975b9afe08..b7f8e95798ca8 100644
--- a/browser/components/aboutlogins/AboutLoginsChild.sys.mjs
+++ b/browser/components/aboutlogins/AboutLoginsChild.sys.mjs
@@ -107,9 +107,17 @@ export class AboutLoginsChild extends JSWindowActorChild {
         this.#aboutLoginsUpdateLogin(event.detail);
         break;
       }
+      case "MozWillRevealPassword": {
+        this.#willRevealPassword(event);
+        break;
+      }
     }
   }
 
+  #willRevealPassword(event) {
+    dump(`MozWillRevealPassword(${event.target.outerHTML})\n`);
+  }
+
   #aboutLoginsInit() {
     this.sendAsyncMessage("AboutLogins:Subscribe");
 
Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #7)

Ah makes sense! Thanks.

Attachment #9324791 - Attachment description: Bug 1750072 - Untested: Allow to prevent password revealing. r=mtigley → Bug 1750072 - Allow to prevent password revealing/unrevealing. r=mtigley
Pushed by mtigley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/49d0f7fb2091 Allow to prevent password revealing/unrevealing. r=mtigley
Keywords: leave-open
Whiteboard: [fxcm-productive-ux]
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: