quill-image-drop-module icon indicating copy to clipboard operation
quill-image-drop-module copied to clipboard

Does it work in Chrome?

Open pmarcini opened this issue 6 years ago • 7 comments

I can't seem to get the demo to work in chrome: https://plnkr.co/edit/ubVmPkBjqQESsefM3JrT?p=preview However, it will work in FF, IE. Is there some sort of security setting needed to enable it to work in Chrome?

Thanks

pmarcini avatar Mar 24 '18 15:03 pmarcini

I can confirm this used to work in Chrome earlier this year, but seems to no longer work (possibly as of Chrome 66).

It seems now, clipboard permissions are blocked unless using localhost or a secure site. (See https://developers.google.com/web/updates/2018/03/clipboardapi for more information.)

However, pasting an image the first time on a page does not prompt for access to read the clipboard and no image shows. Nor does explicitly allowing clipboard access, which can be found here:

Click the info icon (localhost) or the lock icon (https host) in the address bar > Site settings > Clipboard > Allow

I noticed that this module uses the fallback synchronous method (https://github.com/kensnyder/quill-image-drop-module/blob/dabeb264ce20005f452166f028d02e6594cd9729/src/ImageDrop.js#L21), however it is not currently working in Chrome.

brianreeve avatar May 19 '18 16:05 brianreeve

Hello,

It seems indeed not to work in Chrome for me too. I opened the dev tools and found that the paste is handled correctly by Chrome, but that there seems to be a bug in the library (maybe I'm just not using the version of Quill this library was written for): image The variable t contains

{ index: 36, length: 0}

therefore the condition which allows to insert the image is never met.

@kensnyder would you accept a PR on this? I would:

  • remove the check for text selection. I think if someone has selected some text and does a paste does not mean that the paste should not happen
  • Remove the timeout. I don't understand why it's there...

stropitek avatar May 31 '18 14:05 stropitek

Any progress on this? Thanks!

poshest avatar Sep 19 '18 08:09 poshest

any progress? paste image, it's a important feature for me.

sunchenguang avatar Sep 25 '18 07:09 sunchenguang

just remove the condition, it works

sunchenguang avatar Oct 11 '18 15:10 sunchenguang

this is problem for me, it doesn't work in chrome. how to deal with it?

chentianming11 avatar Oct 27 '18 17:10 chentianming11

By removing condition it's partially working on Chrome. Working - Open an image and copy from that editor or in windows os do print screen, then paste is working fine Not working - Directly copy an image file from explorer and then paste, it is not working

hparth avatar Sep 17 '19 07:09 hparth