Open hamed-musallam opened 1 year ago
It also does not work one Firefox but it used to work apparently (in v0.23.0).
@targos I think we discussed already about this issue but I don't remember the conclusion.
I don't remember either.
@hamed-musallam Could you try to investigate this issue ? I don't see any error in the console but there may be an issue between the 'click' and the 'event'. I think the browser needs to know that there is a cause to effect relationship between the click and the clipboard.write call (for security reason). The complexity of the application could explain that some browsers can not track the sequence of events.
Concerning Firefox I also think that copy as an image is currently not supported using 'write': https://caniuse.com/async-clipboard. However it supports 'setImageData' that should solve this issue: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/clipboard/setImageData. So you can check which version to use depending the availability of the method.
To use setImageData
, an extension must be added to Firefox, which is an extra step that I think all users will not do. Therefore, for now, I will maintain the current workaround solution
Yeah, asking the user to install an extension just for copy to clipboard feature is too much (and we would have to maintain that extension)
I checked Firefox again and the Nightly build is now working !
I like bugs that solves by themself ;) (kind of).
However it still does not work on Safari and I don't know why. There is no error message. We should at least not give a message that it is being copied if it is not.
@hamed-musallam Could you check the Safari issue ?
_Originally posted by @hamed-musallam in https://github.com/cheminfo/nmrium/pull/2712#discussion_r1363610730_