0

I'm trying to determine the event/code associated with a mouse-click event in the browser, so that I can bind it to a custom keyboard shortcut.

My example is to open "Saved Logins" with "Show Passwords" set to 'on' i.e. passwords are displayed. I do realize this may not be advisable due to security concerns, so please consider this as for my own use only i.e. not necessarily needing to fulfill the requirements of a new Firefox extension.

So, is there a way to use the following code to get there? Using 'Browser Toolbox' to inspect the button Logins and Passwords, I find the following - am guessing this is in Java:

function() {
  if (LoginHelper.managementURI) {
    window.docShell.messageManager.sendAsyncMessage("PasswordManager:OpenPreferences", {
      entryPoint: "preferences",
    });
    return;
  }
  Services.telemetry.recordEvent("pwmgr", "open_management", "preferences");
  gSubDialog.open("chrome://passwordmgr/content/passwordManager.xul");
}

After a >4 hours on the developer page I'm still not quite getting the next step here to implement this...

Entering some of this script on the Web Console (activated with Strl + shift + k ) typically results in error like that below - perhaps it's not a JAVA interpreter?

ReferenceError: gSubDialog is not defined

The Logins and Passwords button can be accessed via:

  1. left-click the 'hamburger' button enter image description here -then-> a menu drops down with contains the item Logins and Passwords (between Libary and Add-ons - this appears to be a recent change in Firefox).
  2. left-click on "Logins and Passwords" --> opens a new window called Saved Logins, which has the Show Passwords button in the lower right, something like this (my scribbles added): enter image description here
  3. left-click on "Show Passwords" + confirm i.e. answer "Yes" to the Confirm popup asking "Are you sure you wish to show your passwords?"

Or via

  1. menu-bar "Edit" --> Preferences i.e. Alt + e , n
  2. as the cursor starts in the "Find in Preferences" bar, type saved logins then tab twice then Enter or left-click "Privacy and Security" button -then-> left-click "Saved Logins" button ( Alt + shift + l twice, then Enter )

Also, is there a variable somewhere which can be set so that Show Passwords (or whatever it's called) is set to true (or whatever) by default?

At this point, I'd be glad to use a method acting on Firefox 'from above' or 'from outside' to implement the functionality. I'd prefer not to use something that requires specific mouse co-ordinates so that it will work independently of the window/ display/monitor settings.

Version info: Firefox Quantum 68.0 (64-bit) , Mozilla Firefox for Ubuntu, canonical - 1.0

dardisco
  • 4,896
  • 2
  • 37
  • 52

1 Answers1

2

I would love a "logins and passwords" shortcut implemented as well. It shocks me that there is not a procedure already available for mouse-clicks in a particular location within the browser. There could be all kinds of applications for a script like that.

I'm not a programmer (just started working towards my Computer Science degree :) ), but I poked around for a minute and found some discussions that might be of use to you in pursuit of this goal.

For mouse-clicks in a specific location in Firefox:

https://sqa.stackexchange.com/questions/20750/selenium-java-robot-how-to-click-on-particular-locationx-y-of-firefox-browse

For mouse-clicks in a specific location in WPF:

How can I simulate a mouse click at a certain position on the screen?

Best of luck.

  • Yes, shocking. As above, a solution using mouse co-ordinates isn't going to translate nicely from one display/ screen to another, although it's worth considering as a 'last resort'. Also, I'd prefer to avoid having to get familiar with `C#` and/or `selenium` just for the sake of this question... – dardisco Jul 18 '19 at 06:16