Firefox 50 makes image pasting hack superfluous

(Claas Aug.) #1

There is still some time until Firefox 50 becomes stable in November 2016, but as a noteworthy number of developers could use it already from September when it will promoted to Firefox Developer Edition (in fact, I’m using it already with Firefox Nightly), I suppose it is not too early to point out that the following firefoxPastingHack for pasting images will not be necessary (and even counterproductive) any more due to clipboardData.items being implemented in Firefox 50 (see Mozilla Bug 906420):

This said, pasting an image into Discourse using Firefox 50 currently yields two to four (mostly three) instances of the same image being inserted:

This is due to the fact that the paste event contains both a png and a jpeg version of the image. Whether this is intended or not, is expected to be cleared very soon (in Mozilla Bug 1290688) and so we can anticipate a fix or (if it’s a feature) a hint on how to solve this conceptually.

Add IE11 Support for pasting images in the composer
(Sam Saffron) #2

Nice, perhaps we can switch to feature detection as opposed to user agent ?

(Claas Aug.) #3

That would be ideal. If not possible, it would suffice to add a version constraint here:

(Claas Aug.) #4

The issue is now fixed in Discourse and in Firefox, so this topic can be closed.

(Rafael dos Santos Silva) #5