# Firefox 50 makes image pasting hack superfluous

**URL:** <https://meta.discourse.org/t/firefox-50-makes-image-pasting-hack-superfluous/48017>\
**Category:** Development\
**Created:** [2016 年 7 月 31 日午前 2:25 UTC](https://meta.discourse.org/t/firefox-50-makes-image-pasting-hack-superfluous/48017 "2016-07-31T02:25:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)\
**Post date:** [2016 年 7 月 31 日午前 2:25 UTC](https://meta.discourse.org/t/firefox-50-makes-image-pasting-hack-superfluous/48017/1 "2016-07-31T02:25:33Z")

</div>

There is still some time until [Firefox 50 becomes stable in November 2016](https://wiki.mozilla.org/RapidRelease/Calendar), but as a noteworthy number of developers could use it already from September when it will promoted to [Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/developer/) (in fact, I’m using it already with [Firefox Nightly](https://nightly.mozilla.org/)), 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](https://bugzilla.mozilla.org/show_bug.cgi?id=906420)):

> <https://github.com/discourse/discourse/blob/3200d836f70a4233c3d7b8ed7605ba1d2720d314/app/assets/javascripts/discourse/components/composer-editor.js.es6#L296-L377>

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

> ![](https://global.discourse-cdn.com/meta/original/3X/8/f/8f9c2c3fb9b0a1367502743f84b81dd94becb7cd.png)

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](https://bugzilla.mozilla.org/show_bug.cgi?id=1290688)) and so we can anticipate a fix or (if it’s a feature) a hint on how to solve this conceptually.

---

_[View the full topic](https://meta.discourse.org/t/firefox-50-makes-image-pasting-hack-superfluous/48017)._
