browserpass / browserpass-legacy

Legacy Browserpass repo, development is now happening at:
https://github.com/browserpass/browserpass-extension
MIT License
1k stars 80 forks source link

With store locked, selecting copy user|pass does not successfully copy after decrypting #241

Closed jangari closed 6 years ago

jangari commented 6 years ago

General information

If my password store is in a locked state, selecting the copy password or copy username options, then after being prompted to decrypt, the password or username is not copied to the clipboard and I have to re-search and re-select copy to copy it to the clipboard.

I would expect that after decrypting the entry, the copy command would be issued.

This does not correspond to the behaviour for sites which are found by browserpass; when I try to auto-enter the credentials with the store locked, then after decrypting the entry the credentials are passed automatically without me having to select the entry again.


Exact steps to reproduce the problem

  1. Have a locked password store
  2. Search for an entry
  3. Click key icon to copy password
  4. Enter GPG key to decrypt
  5. Paste the password from the clipboard

What should happen?

Password from the selected entry should be pasted and should be on the clipboard.

What happened instead?

Clipboard is unchanged. To successfully copy the password, repeat steps 1, 2 and 4 above.

maximbaz commented 6 years ago

Thanks for reporting, I had a suspicion that we had this issue, but never got a chance to confirm.

Filling passwords works because it was intentionally implemented in #119, I think re-using the same approach will do the trick here too. I'll have a look 🙂

maximbaz commented 6 years ago

This is caused because the code that copies the text in clipboard is located in the popup, once popup is closed, everything is stopped.

I tried a few approaches:

Ended up with the following approach in b717a5c:

That way, this works as expected in Chrome and cannot be implemented in Firefox. Sorry, Firefox users.

jangari commented 6 years ago

Thanks! Woke up this morning to find the new behaviour! Shame about Firefox users though.