Add IE11 Support for pasting images in the composer


(Sam Saffron) #1

Turns out pasting images into composer is workable in IE11

We should get it working.


(Jeff Atwood) #2

Would love to see a community PR in this area! I assume IE11 is now standardizing here…


(Jeff Atwood) #3

@falco would you be interested in researching this?


(Rafael dos Santos Silva) #4

It looks it’s the same story as Firefox, you can only paste on ContentEditable elements. So I have a plan to extend the Firefox Pasting behavior. Should have something tomorrow.

BTW, it already works on edge.


(Jeff Atwood) #5

Even if it is Edge only that would be fine. What we have now is a whole lot of nothing. Bonus points for researching the current state of Safari in this regard as well.


(Rafael dos Santos Silva) #6

Actually, it’s already working for me on Edge (Build 38.14393.0.0)

The hack would be to add IE 11 support only. Will see what is safari state now.


(Jeff Atwood) #7

Oh I was not aware it worked on Edge already. Ie11 support is not a priority. Safari would be way more of our audience.

Edit: remember this topic is from 2014 :sun_with_face:


(Rafael dos Santos Silva) #8

Yes, but things aren’t looking good for Safari.

All the documentation I’ve found points to it being not possible atm…

⚓ T7916 Can't paste images from clipboard in Firefox / Safari and Safari image pasting may be supported · Issue #21 · layerssss/paste.js · GitHub

Looks like Safari behave like Firefox, but provides a local-only URL inaccessible by online js.


(Jeff Atwood) #9

All right, then the only news is this already works on Edge with no changes on our end? That is fine.


(Rafael dos Santos Silva) #10

And we can begin to ditch the Firefox hack when 50+ gets enough market share:


(Jeff Atwood) #11

Did we ever revisit this @falco? Not for IE11 :rofl: but for Firefox / Safari?


(Penar Musaraj) #12

I copy/paste images regularly on Safari (I’ve set up screen grabbing to save the image in clipboard). Just tested on Firefox and it works there too.


(Jeff Atwood) #13

Right but can we remove the “Firefox hack”? Or did we already do this when @joffreyjaffeux reworked the composer? :thinking:


(Penar Musaraj) #14

The hack is still there but looks like we can remove it. Pasting an image works on Firefox/Mac for me without the hack. Will do a quick test in a VM and commit if it’s good there too.


(Jeff Atwood) #15

less code = more betterer


(Penar Musaraj) #16

Firefox hack removed via DEV: Remove old _firefoxPastingHack · discourse/discourse@f400830 · GitHub


(Penar Musaraj) closed #17

(Jeff Atwood) #18

Also Firefox 50 was released November 2016. So we should be well clear of that.