Closed Bug 1716016 Opened 4 years ago Closed 3 years ago

Copy-pasting image from Firefox to Chrome pastes image twice

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

Firefox 89
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: ndaltamirano, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

In firefox, right click to copy an image.

Go to https://imgur.com/upload (or any other website where you can paste an image)

press Ctrl+V

Actual results:

The image gets pasted twice.

Expected results:

The image gets pasted only once

Pasting should be done in Chrome. Sorry, forgot to add that to the steps.

Summary: Copy-paste problem confirmed on firefox 89.0 and chrome 91 on windows 10. → Copy-pasting image from Firefox to Chrome pastes image twice
Component: DOM: Editor → DOM: Copy & Paste and Drag & Drop

Fixed in version 90.0.2

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

Wanted to come in here and mention this issue is actually still happening when pasting into the Signal desktop client.

Can confirm copying images from other places onto the clipboard, and then pasting into Signal doesn't cause the duplication but it happens with any Firefox copied image.

(In reply to Ethan Word from comment #3)

Wanted to come in here and mention this issue is actually still happening when pasting into the Signal desktop client.

Can confirm copying images from other places onto the clipboard, and then pasting into Signal doesn't cause the duplication but it happens with any Firefox copied image.

Ethan: on which OS with which Firefox version does it happen?

Flags: needinfo?(planedrop)

(In reply to Mirko Brodesser (:mbrodesser) from comment #4)

(In reply to Ethan Word from comment #3)

Wanted to come in here and mention this issue is actually still happening when pasting into the Signal desktop client.

Can confirm copying images from other places onto the clipboard, and then pasting into Signal doesn't cause the duplication but it happens with any Firefox copied image.

Ethan: on which OS with which Firefox version does it happen?

Yes, sorry I should have included more information.

Running Firefox 92.0.1 right now (was happening on the previous version as well).

It's happening on both my laptop and desktop which are both running Windows 11 latest beta build which is 22000.194 (21H2).

Flags: needinfo?(planedrop)

I can confirm that the behavior described in comment 4, is also reproducible on my end, using Win 11 and Win 10. The image copied to clipboard via context menu from Firefox (95.0a1, 94.0b2 and 93.0), appear duplicated when pasted to the Signal texting app. Note that one of the pasted image does not correctly load into the app's texting field, it appears to have an infinite loading indicator.

The bug can be reproducible on older builds, it goes back to Nightly 58.0a1 (Build ID 20171004220309) as well. Let me know if we can help with more info!

(In reply to Ciprian Georgiu [:ciprian_georgiu], Release Desktop QA from comment #6)

I can confirm that the behavior described in comment 4, is also reproducible on my end, using Win 11 and Win 10. The image copied to clipboard via context menu from Firefox (95.0a1, 94.0b2 and 93.0), appear duplicated when pasted to the Signal texting app. Note that one of the pasted image does not correctly load into the app's texting field, it appears to have an infinite loading indicator.

The bug can be reproducible on older builds, it goes back to Nightly 58.0a1 (Build ID 20171004220309) as well. Let me know if we can help with more info!

OK glad it's not just me.

I can also confirm that it shows the infinite loading for the second image. One additional point, it didn't used to do that, that part is new. Going back like 2-3 weeks it would actually paste both images and they would both work, but now the second one just loads forever.

it reminds me of Bug 1699935
Mirko had a nice script for testing it.
https://bugzilla.mozilla.org/attachment.cgi?id=9211222

function addPasteEventListener() {
  document.addEventListener("paste", (event) => {
    console.log(
      "event.clipboardData.types.length: " + event.clipboardData.types.length
    );
    const types = event.clipboardData.types;
    for (i = 0; i < types.length; ++i) {
      console.log("event.clipboardData.types[" + i + "]: " + types[i]);
    }

    const items = event.clipboardData.items;
    console.log("event.clipboardData.items.length: " + items.length);
    let numberOfCalledCallbacks = 0;
    for (i = 0; i < items.length; ++i) {
      items[i].getAsString((s) => {
        console.log(
          "event.clipboardData.items[" + numberOfCalledCallbacks + "]: " + s
        );
        ++numberOfCalledCallbacks;
      });
    }

    console.log(
      "event.clipboardData.files.length: " + event.clipboardData.files.length
    );

    for (i = 0; i < event.clipboardData.files.length; ++i) {
      console.log(
        "event.clipboardData.files[" +
          i +
          "].type: " +
          event.clipboardData.files[i].type
      );
    }
  });
}

function onLoad(event) {
  console.log("onload");
  document.querySelector("div").focus();
  addPasteEventListener();
}

window.onload = onLoad;

Signal-developers are aware of the issue, see https://github.com/signalapp/Signal-Desktop/issues/5510. According to https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-917093938 a fix should is pending. The bug seems to occur also when copying from other apps (see https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-933060613). The fix will take some time to be available to end-users, see https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-933532333.

(In reply to Mirko Brodesser (:mbrodesser) from comment #9)

Signal-developers are aware of the issue, see https://github.com/signalapp/Signal-Desktop/issues/5510. According to https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-917093938 a fix should is pending. The bug seems to occur also when copying from other apps (see https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-933060613). The fix will take some time to be available to end-users, see https://github.com/signalapp/Signal-Desktop/issues/5510#issuecomment-933532333.

OK good to know, thanks!

See Also: → 1736944

Just a note that I was seeing this behavior with the Slack desktop app on Windows for a while, it seems to have gone away (they likely updated Electron). Discord's Desktop application now has this issue.

Was there ever a dive into why this only happens with Firefox (and some other apps) -> Electron v13 and never Chrome -> Electron ? Is Firefox doing something 'smarter', 'dumber', or just different than Chromium?

(In reply to rileylabrecque from comment #11)

Just a note that I was seeing this behavior with the Slack desktop app on Windows for a while, it seems to have gone away (they likely updated Electron). Discord's Desktop application now has this issue.

Was there ever a dive into why this only happens with Firefox (and some other apps) -> Electron v13 and never Chrome -> Electron ? Is Firefox doing something 'smarter', 'dumber', or just different than Chromium?

I didn't dig into the details or don't remember.

In general, Firefox exports slightly different information to the clipboard than Chrome. E.g., there are Mozilla-specific clipboard flavors (https://searchfox.org/mozilla-central/rev/4ca2f73ae9346709d39de2c8fe33874e4203b9e6/widget/nsITransferable.idl#42-43). Those flavors likely aren't the problem here, they're just examples of differences. Presumably Firefox's behavior is just different. Of course, that isn't ideal.

(In reply to Mirko Brodesser (:mbrodesser) from comment #12)

(In reply to rileylabrecque from comment #11)

Just a note that I was seeing this behavior with the Slack desktop app on Windows for a while, it seems to have gone away (they likely updated Electron). Discord's Desktop application now has this issue.

Was there ever a dive into why this only happens with Firefox (and some other apps) -> Electron v13 and never Chrome -> Electron ? Is Firefox doing something 'smarter', 'dumber', or just different than Chromium?

I didn't dig into the details or don't remember.

In general, Firefox exports slightly different information to the clipboard than Chrome. E.g., there are Mozilla-specific clipboard flavors (https://searchfox.org/mozilla-central/rev/4ca2f73ae9346709d39de2c8fe33874e4203b9e6/widget/nsITransferable.idl#42-43). Those flavors likely aren't the problem here, they're just examples of differences. Presumably Firefox's behavior is just different. Of course, that isn't ideal.

Agreed it's not ideal, very odd for sure and hoping we get a fix for this at some point. I personally am not using FF much anymore though, the lack of PWA support for any website (which yes I know isn't technically an actual PWA) honestly ruins it for me entirely; but that is a topic for another time.

Point is, I'm pretty sure this is still happening with the most up to date version.

Agreed it's not ideal, very odd for sure and hoping we get a fix for this at some point. I personally am not using FF much anymore though, the lack of PWA support for any website (which yes I know isn't technically an actual PWA) honestly ruins it for me entirely; but that is a topic for another time.

Point is, I'm pretty sure this is still happening with the most up to date version.

This specific bug is not happening for me. BUT, FF copy-paste image handling is odd at best.

Try copying and pasting the exact same image from FF into Chrome, and from Chrome into Chrome. You'll notice that it takes around 2-3 seconds until the image shows up, while with Chrome it's almost instantaneous.

(In reply to ndaltamirano from comment #14)

Agreed it's not ideal, very odd for sure and hoping we get a fix for this at some point. I personally am not using FF much anymore though, the lack of PWA support for any website (which yes I know isn't technically an actual PWA) honestly ruins it for me entirely; but that is a topic for another time.

Point is, I'm pretty sure this is still happening with the most up to date version.

This specific bug is not happening for me. BUT, FF copy-paste image handling is odd at best.

Try copying and pasting the exact same image from FF into Chrome, and from Chrome into Chrome. You'll notice that it takes around 2-3 seconds until the image shows up, while with Chrome it's almost instantaneous.

Yes, it's definitely not being done "right" IMO, hopefully FF redoes it to be similar to the way it works in Chromium.

You need to log in before you can comment on or make changes to this bug.