Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Den här webbplatsen har begränsad funktionalitet medan vi utför underhåll för att förbättra din upplevelse. Om en artikel inte löser ditt problem och du vill ställa en fråga har vi vår gemenskap som väntar på att hjälpa dig på @FirefoxSupport på Twitter, /r/firefox på Reddit.

Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Läs mer

Firefox copies images into clipboard in a weird format?

  • 5 svar
  • 3 har detta problem
  • 14 visningar
  • Senaste svar av borekb

more options

When I right-click on PNG or JPG image inside some webpage and select "Copy Image", I have a feeling that it gets stored in some "weird" format in my Windows clipboard. I say that because when I simply do Ctrl+V in Twitter or Slack, it should paste the image but it doesn't. I need to open something like Paint, paste there, then do Ctrl+C again and now pasting into Twitter or Slack in Firefox works. Really the only explanation I have is there's something funky about the clipboard storage format used by Firefox. Or what could it be?

When I right-click on PNG or JPG image inside some webpage and select "Copy Image", I have a feeling that it gets stored in some "weird" format in my Windows clipboard. I say that because when I simply do Ctrl+V in Twitter or Slack, it should paste the image but it doesn't. I need to open something like Paint, paste there, then do Ctrl+C again and now pasting into Twitter or Slack in Firefox works. Really the only explanation I have is there's something funky about the clipboard storage format used by Firefox. Or what could it be?

Alla svar (5)

more options

I'm waiting for a password reset on Twitter so I can't test at the moment...

Do you recall having this issue in Firefox 43 or 44? There have been some clipboard changes recently, with Firefox 44 removing legacy formats and Firefox 45 expected to undo that change. Somewhere in there, something might have happened regarding images.

more options

I'm not quite sure, honestly. I think I've had this problem for a couple of months now but I may be wrong. BTW I am on Firefox 45.0b6.

more options

You can use code like this in the Browser Console to check if a specific MIME type is on the clipboard.

  • Services.clipboard.hasDataMatchingFlavors(["image/png"], 1, clipboard.kGlobalClipboard);
  • Services.clipboard.hasDataMatchingFlavors(["image/jpg"], 1, clipboard.kGlobalClipboard);

See also:

more options

A long time ago, in Firefox 12, Firefox starting including a HTML link on the clipboard when you Copy Image. This was to facilitate easy image embedding in Gmail messages.

When I paste into Twitter, nothing seems to happen, but if I rapidly repeat pressing Ctrl+v I can see the image occasionally added and removed, as though Twitter is receiving, rendering, and rejecting the HTML format. It kind of makes sense that Firefox is giving Twitter the HTML.

So far, no workarounds have come to mind...

more options

@jscher2000 That is great info, thanks. I've installed this clipboard viewer and indeed, there's "HTML Format" entry with this contents:

Version:0.9 StartHTML:00000097 EndHTML:00000343 StartFragment:00000131 EndFragment:00000307 <html><body> <!--StartFragment--><img style="MARGIN-TOP: 0.5em; MARGIN-LEFT: 0.5em" alt="Windows Clipboard Viewer" src="http://www.freeclipboardviewer.com/images/windowsclipboard.png" height="372" width="450"><!--EndFragment--> </body> </html>

Then, there's a couple of image formats:

http://snag.gy/lc6YB.jpg

I agree that it does make sense to include the HTML into the copied data so maybe it's a paste problem? Like, in Twitter, paste is actually broken?

(However, I've just tried the same in Chrome and it behaves the same, i.e., paste doesn't work, and when I right-click and "Copy Image" in Chrome, it also stores a similar piece of HTML into the clipboard.)

This is really unpleasant from the user perspective - I have an image in my clipboard, the paste should just work.

Ändrad av borekb