yomichan icon indicating copy to clipboard operation
yomichan copied to clipboard

Clipboard image doesn't get copied to Anki

Open thatfatblackcat opened this issue 2 years ago • 2 comments

Description If I'm understanding this correctly, Yomichan reads the image that you have copied to the clipboard and then when you request to make a new card it should get copied again onto it. This doesn't work for me.

I repeated the process both on Firefox and Chromium but the result is always a blank field. I also tried with a new profile but no success. I'm running Linux Mint 20.3 Cinnamon.

PS: I was looking for a solution on other issues and I found a snippet of code on #1675 so I tried that. If I copy an image from the Internet I get a string of an img tag with src equal to the URL of the image resulting in a blank field. While if I make a screenshot I get a proper img tag with src equal to the data of the image in base64 and everything is good.

I want to use an image from the Internet, is there any way I can make it work?

Browser version Chromium 98.0 Firefox 97.0

Yomichan version 21.10.31.1 on both Chromium and Firefox

thatfatblackcat avatar Feb 12 '22 20:02 thatfatblackcat

Same issue here with Chrome 99.0 and macOS Monterey.

Works with screenshot but not with online images.

mathewthe2 avatar Mar 12 '22 04:03 mathewthe2

As it stands currently, there's not a generic way to do this that covers all use potential use cases. E.g. if viewing on a file: URL, the extension still wouldn't be able to fetch the image since that's a security issue.

Additionally, Chrome has plans which will effectively break all clipboard-related functionality unless they add new APIs.

~~In Firefox, you might be able to get this to work if you enable the dom.events.asyncClipboard.read setting to true in about:config (docs).~~ Actually looks like this API changed at some point and now Yomichan doesn't handle it properly anymore. (#2085)

toasted-nutbread avatar Mar 13 '22 17:03 toasted-nutbread