I'm making a Firefox extension that gets the selected password hashes it and returns it Only thing that's bugging me is how to get the selected password
browser.contextMenus.create({
id: "SecurePass",
title: "SecurePass your Pass!",
contexts: ["password"],
});
browser.contextMenus.onClicked.addListener(function(info, tab) {
switch (info.menuItemId) {
case "SecurePass":
const text = "This is password: " + info.value;
console.log(text);
break;
}
})
Output of info:
Object { menuItemId: "SecurePass", parentMenuItemId: 10, viewType: "tab", frameId: 0, editable: true, targetElementId: 864623, pageUrl: "https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2f", modifiers: [], button: 0 }
button: 0
editable: true
frameId: 0
menuItemId: "SecurePass"
modifiers: Array []
pageUrl: "https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2f"
parentMenuItemId: 10
targetElementId: 864623
viewType: "tab"