Firefox has quirky copy/paste image behavior


(@SenpaiMass) #1

How to repro. Firefox Only (latest)

  1. Open any image from imgur/imageshack etc…
  2. Copy Image. (Do not copy image URL/Just copy image)
  3. Paste the image on your latest upgraded Discourse community, Instead of uploading the image, the link of the image gets copied.

On Chrome you get the image uploaded to the community. Firefox latest image upload does not take place.


Help us test our new post rendering engine!
Help us test our new post rendering engine!
(Mittineague) #4

When I right-click “Copy Image” using Firefox, it does not enable the right-click paste option.

But control-v works

I’ve always thought it was a Firefox issue (i.e. clipboard), not a Discourse issue

Copy - Paste text works fine.


(@SenpaiMass) #5

Control + V works to paste the image, that’s what i have been doing and i loved this feature it was awesome and time saving.

But it just copies the image url, not upload it. For example try pasting this image below
http://i.imgur.com/1Cw4eDI.jpg

The result would be

<img src='http://i.imgur.com/1Cw4eDI.jpg'>

As you can see it did copy the image URL, Instead of uploading the image. (On chrome it uploads the image to the discourse)

Edit - Sorry about my English.


(Jeff Wong) #6

Pretty sure this is by design. Firefox image pasting looks pretty difficult to deal with, so this is the team’s best effort. See the relevant comment in the code here:


(TechnoBear) #7

Right-click “copy image” followed by Ctrl+V pasting works fine for me on Firefox. (44.0.2 on Ubuntu Gnome 15.10).

However, as of this afternoon, I no longer seem to be able to use drag-and-drop image upload in Firefox, either here or on SitePoint. Firefox updated this morning, so that’s probably when the change occurred.


(@SenpaiMass) #8

it did not work because the image you posted was not uploaded to meta.discourse.org
https://pixabay.com/static/uploads/photo/2016/01/30/17/41/africa-1170108_960_720.jpg
This is the image link.


(TechnoBear) #9

My apologies - I had misunderstood the issue.


(Jeff Atwood) #10

@eviltrout can you check next week and make sure we didn’t have any regressions here?


(Robin Ward) #11

I tried on the latest Firefox on try.discourse.org and it seems to be working fine? Perhaps it’s an issue with the particular image that was tried.


(TechnoBear) #12

But this seems to be doing what the elephant picture did (above) and linking to pixabay, rather than uploading to Discourse. (And the original report was using images on imgur, so it seems not to be the image or the site.)

Firefox 44.0.2 on Ubuntu Gnome 15.10.


(Kane York) #13

You’re sure you’re using right click, Copy Image?


(Robin Ward) #14

I just tried again to make sure. Curiously that didn’t copy the image when I did it in Firefox, it copied a URL to it, but it still worked.

I also tried with a larger image. It took a while to upload, but it did finish and then Firefox told me the image was too large to upload.


(TechnoBear) #15

But that’s the reported bug; “copy image” and paste is behaving exactly as “copy image location” and paste; it isn’t uploading the image to Discourse.

(I don’t generally use this method with Discourse, so can’t say whether this is a recent issue or not.)


(Robin Ward) #16

Wow now I feel dumb! That is interesting and perhaps out of our control. I will check it out.


(Robin Ward) #17

This is not something that is easy to change.

  • If there is an image in the clipboard, copied from any other application, pasting in Firefox works fine.

  • If the image was copied in Firefox using Copy Image, pasting no longer gives our application the data that we can parse, and only gives us the URL.

I think Discourse is doing the right thing in this case. Since it doesn’t have the image data to upload, it inserts the URL in the document as if that was copied and pasted.