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:
- left-click the 'hamburger' button
-then-> a menu drops down with contains the item
Logins and Passwords(betweenLibaryandAdd-ons- this appears to be a recent change in Firefox). - left-click on "Logins and Passwords" --> opens a new window called
Saved Logins, which has theShow Passwordsbutton in the lower right, something like this (my scribbles added): - 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
- menu-bar "Edit" --> Preferences i.e. Alt + e , n
- 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