InlineAttachment icon indicating copy to clipboard operation
InlineAttachment copied to clipboard

doesn't work in firefox 26(latest)

Open jurek7 opened this issue 11 years ago • 12 comments

On paste only(drag & drop works):

TypeError: clipboardData.items is undefined

jurek7 avatar Jan 07 '14 09:01 jurek7

Hi Jurek,

This may relate to a comment i posted earlier about browser compatibility, https://github.com/Rovak/InlineAttachment/issues/22#issuecomment-31296773

I will doublecheck if anything has changed in the latest firefox which may allow the browser to read clipboard data during a paste event.

Rovak avatar Jan 07 '14 09:01 Rovak

i checked similar javascript on http://pasteboard.co/ and it works.

jurek7 avatar Jan 07 '14 09:01 jurek7

Thanks for pointing to a working implementation in firefox, most likely it is using a contenteditable element which catches paste event with the data. I'm not sure how this works in combination with a textarea.

I will keep this issue open for further research

Rovak avatar Jan 07 '14 10:01 Rovak

I'm totally agree about the compatibility check, however I just created a PR to mitigate this issue.

https://github.com/Rovak/InlineAttachment/pull/31

fcsonline avatar Feb 05 '14 11:02 fcsonline

Here is another link, that may show some pointers about how to do it in firefox. http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/

BTW, the link is from the same guy who did pasteboard.co , at least that is what I read in some forum.

I read somewhere else also(can't remember the URL, shall check and post again) which has a working version in Chrome, but for firefox, mentions, just loose focus from the text area and then paste. So I think, that trick could also be used. I had checked it to be working fine too on firefox, but after losing focus from the area of interest.

acpadhi avatar Oct 03 '14 20:10 acpadhi

Thanks for the pointers, i will try and implement it in version 2

Rovak avatar Oct 08 '14 20:10 Rovak

Got a prototype working in #41

Rovak avatar Oct 10 '14 21:10 Rovak

Excellent. Already past midnight here. I will try it over the weekend and report my findings.

For the time being, I am already using your published version in my personal website which i am developing for blogging purposes. I am surely keen to have this working well, and most likely will explore options on how to integrate with CK Editor as well in the simplest way.

Shall keep you posted on my testing with your recent changes around weekend or Monday.

acpadhi avatar Oct 10 '14 21:10 acpadhi

I just made an update which moved the firefox logic to the core of InlineAttachment, this means it should now "just work" without making any changes to existing code.

I only made it for the default textarea now (see https://github.com/Rovak/InlineAttachment/blob/2.0.0-firefox/demo/input.html), i will add the other editors later.

Rovak avatar Oct 16 '14 20:10 Rovak

Hi, rovak, you might want to check out my work paste.js. I managed to made a unified image-pasting interface for IE9+/Chrome/Firefox. Hope it can help solve this issue.

Anyway, I still can't make it work for safari. It seems hopeless.

layerssss avatar Nov 20 '14 16:11 layerssss

@layerssss thanks for the pointer! I will take a look at it.

Rovak avatar Dec 05 '14 09:12 Rovak

Looks like Paste events will be supported in Firefox 41, see https://developer.mozilla.org/en-US/Firefox/Releases/41. Will add support when 41 is released

Rovak avatar Jul 26 '15 10:07 Rovak