Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysPass 2.1.2 - copy to clipboard error #500

Closed
luk6173 opened this issue Mar 14, 2017 · 37 comments
Closed

sysPass 2.1.2 - copy to clipboard error #500

luk6173 opened this issue Mar 14, 2017 · 37 comments

Comments

@luk6173
Copy link

luk6173 commented Mar 14, 2017

Hi,

I can't copy any password to clipboard. I'm getting a error:

Error copying to clipboard

No entries regarding this in syspass.log available.

@nuxsmin nuxsmin self-assigned this Mar 14, 2017
@nuxsmin
Copy link
Owner

nuxsmin commented Mar 14, 2017

Hi Lukas,

which browser are you using? (sorry I missed your previous post)

@luk6173
Copy link
Author

luk6173 commented Mar 14, 2017

FireFox ESR 45.6.0

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 14, 2017

Ok, so you told that this issue is related when clicking on the "Copy to Clpboard" icon that is outside the password box. Does the password contain any special char?, Does it work on the demo site?

@luk6173
Copy link
Author

luk6173 commented Mar 14, 2017

On demo site it is working.

One password is -> MaxNCBGLpS

@luk6173
Copy link
Author

luk6173 commented Mar 14, 2017

with Version 2.0 it was working fine...

@luk6173
Copy link
Author

luk6173 commented Mar 15, 2017

Hey Rubén,

I found something out. When I use the "copy to clipboard" button direct on page which shows me my entries, it doesn't work. When I click 1st on "show password" button and press then "copy to clipboard" button, this is working fine.

I hopy you can understand my bad english :)

Br,
Lukas

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 15, 2017

Hey Lukas!

I'm doing some tests. I'll be back shortly.

Your English is quite good...Mine isn't perfect too :)

nuxsmin added a commit that referenced this issue Mar 15, 2017
@luk6173
Copy link
Author

luk6173 commented Mar 16, 2017

Hi Rubén,

i updated to current sysPass version, but the copy to clipboard issue is still present :-(

Br,
Lukas

@maxdie
Copy link

maxdie commented Mar 16, 2017

I have some problem too ! All logs is clean. Debug not show trouble.

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 16, 2017

@maxdie sorry I don't know what you mean :(

@maxdie
Copy link

maxdie commented Mar 16, 2017

Hello. sorry for my English.

I have issue how and lukasp2. CopyPast not work. When I push icon get a message

image

Appache log and sysPass log is empty.

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 16, 2017

Ok @maxdie ...Now I see it's the same issue, the weird thing is that this works on the demo site, does it work for you?

@maxdie
Copy link

maxdie commented Mar 17, 2017

Hello.
I added on demo site in webform customer and category.
First password is simply and add to clipboard, but one time.
Second password more strongly but not copy to clipboard and now simply password do not copy too.

@luk6173
Copy link
Author

luk6173 commented Mar 17, 2017

How we can help you Rubén to do some troubleshooting?

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 17, 2017

Now I see the error on the demo site, it's weird because it didn't happen before.

I'll take a deeper look.

@luk6173
Copy link
Author

luk6173 commented Mar 17, 2017

I love your work and your progress ! ;-)

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 17, 2017

Thanks, I've been testing on Firefox and chrome on Windows and Linux and it didn't fail. I could reproduce the issue on Firefox on android.

@maxdie
Copy link

maxdie commented Mar 19, 2017

I try copy paste password from demo syspass site on my android device. Use google chrome. Trouble like in windows os.
xpsscreenshot_2017-03-19-08-33-22
screenshot_2017-03-19-08-33-14

@luk6173
Copy link
Author

luk6173 commented Mar 19, 2017

@nuxsmin do you have any idea how to fix this problem?

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 20, 2017

@lukasp2 I've been doing some tests and finally I guessed that some mobile browsers don't implement a feature that is required to run a "text copy" action: https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand

The doc tells that Safari and Firefox for iOS don't implement the "execCommand" feature, so the "copy-to-clipboard" feature won't work until being implemented.

I don't know if you are testing on a mobile device, but if it were the case, now you have the answer. Is it?

BTW, I'm trying to find out why it doesn't work on Android mobile devices using Firefox/Chrome. @maxdie

@luk6173
Copy link
Author

luk6173 commented Mar 20, 2017

@nuxsmin I'm trying it with FireFox ESR 45.6.0, IE 11.0.9600.18537 and Vivaldi 1.6.689.40 running on Windows 7 Enterprise SP1 64bit. With all Browsers I get same error while trying to copy password to clipboard

When I use the "copy to clipboard" button direct on page which shows me my entries, it doesn't work. When I click 1st on "show password" button and press then "copy to clipboard" button, this is working fine.

Where is the difference between this both "copy to clipboard" functions?

Thank you,
Lukas

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 20, 2017

@lukasp2 the main difference is that the first one (using the direct button) gets the password from an AJAX request, passes it to the Javascript plugin to copy it to the clipboard. The second one, performs an Ajax request, BUT it sets the password in a field that is shown (password box) and then, when you press the "copy" button, it catches the password from the field and copies it to the clipboard.

To get the clipboard working, the action for copying the text (in this case the password), need to be executed in the user space, because there are some security restrictions that avoid to copy any text in a background process. It's a bit complicated :)

From: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard

You can use the "cut" and "copy" commands without any special permission if you are using them in a short-lived event handler for a user action (for example, a click handler).

@luk6173
Copy link
Author

luk6173 commented Mar 20, 2017

Okay, also my FireFox ESR Release it not up to date. I will try that @Home with current FireFox / Google Chrome releases.

@luk6173
Copy link
Author

luk6173 commented Mar 22, 2017

Update: I tested it on my MacBook (macOS Sierria 10.12.3) with Chrome 57 and FireFox 52....same issue

@nuxsmin
Copy link
Owner

nuxsmin commented Mar 22, 2017

I'm still working on a solution. This is a browser security behavior that is planned to be redesigned to allow asynchronous requests to perform clipboard actions if the user grants permission before using it.

@ejouvin
Copy link
Contributor

ejouvin commented Apr 2, 2017

For me, still have error on my install version 2.1.4
But on demo site, it works fine.

I ma using Chrome

How can we help to debug ?
Has I try to reproduce after writting this comment, it works ...
May be spécific case for specific password ?
Will update comment if I foind something.

When using developer tools
the password can be seen in the Ajax respons.

@nuxsmin
Copy link
Owner

nuxsmin commented Apr 3, 2017

Hello, since this issue occurs in a random way and the current clipboard behavior is a bit restrictive (see a comment above), I could figure out that it happens when the response from the server is delayed, so the password from the Ajax request is not set.

The current behavior is as follows:

  1. User clicks the password button
  2. A click event is triggered
  3. An Ajax request is performed while the click event is waiting
  4. The Ajax request finishes and the password is sent in the response
  5. The password is sent to the clipboard function
  6. The clipboard function creates a pseudo-element to copy the password in it
  7. The password text is selected and copied
  8. A message is displayed

Currently a new clipboard API is being developed (working draft), so Ajax actions will be allowed to send text to the clipboard (https://www.w3.org/TR/clipboard-apis/#integration-with-other-scripts-and-events)

In the meantime, I think that the current session encryption could be the cause of the issue, because it reduces the general performance in terms of speed when performing requests.

nuxsmin added a commit that referenced this issue Apr 3, 2017
…his would increase the app overall performance and prevent some issues when copying to clipboard. Related #524, #523, #500, #486

* [MOD] Bump version&build number
@nuxsmin
Copy link
Owner

nuxsmin commented Apr 3, 2017

Could you try out the latest commit in the master branch?

@luk6173
Copy link
Author

luk6173 commented Apr 3, 2017

When I activate session encryption, then is copy to clipboard working for me with newest Vivaldi Browser.

@ejouvin
Copy link
Contributor

ejouvin commented Apr 3, 2017

Works for me, encryption enabled or not.

So now, I am waiting the new official release.

@nuxsmin
Copy link
Owner

nuxsmin commented Apr 3, 2017

That sounds nice

@neolinux
Copy link

neolinux commented Apr 4, 2017

It's working by me too. 👍

@nuxsmin
Copy link
Owner

nuxsmin commented Apr 4, 2017

Ummm...that sounds to be more likely to a browser update, because there weren't any changes to the clipboard functions code since a few commits ago. The latest commit only implements some new features like enable/disable PHP session encryption and secondary groups accesses.

Thanks for the feedback! 👍

@neolinux
Copy link

neolinux commented Apr 4, 2017

Ok, but i have tested it before and after upgrading from 2.1.1 to 2.1.4 and then to the latest master branch.

I haven't closed my browser or updated it (chrome)...

@nuxsmin
Copy link
Owner

nuxsmin commented Apr 4, 2017

Ok, in your case, there were some intermediate releases that implemented some fixes to that behavior.

@nuxsmin
Copy link
Owner

nuxsmin commented Apr 4, 2017

Solved.

Thanks to everyone for the feedback!

@deajan
Copy link
Contributor

deajan commented Aug 30, 2017

Doesn't work for me, with Opera 47 (lastest) Win x86.
When using the debug console, here's what I get

js.php:162 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants