Clipboard image copy-pastes twice in Gmail
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
People
(Reporter: bugzilla, Assigned: mbrodesser-Igalia)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Steps to reproduce:
To reproduce, take a screenshot of your screen, and try copy-pasting it from your clipboard directly as embedded picture in Gmail. Note that it's important to paste from clipboard, not "pulling the image from a folder".
For screenshots, I use an opensource tool GreenShot. But I tried copying a section of a picture in Paint - and the same bug is present.
This doesn't happen in Chrome or other browsers I tried.
I'm using Firefox v86.0.1 (64-bit), on Windows10 Pro.
Actual results:
Clipboard image is pasted twice in Gmail, consecutively.
Expected results:
We should have a single pasted image in the body of the email.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Editor' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
Hmm, it's odd. I cannot reproduce it if I copy image in Firefox and paste it into the Gmail's composer.
Karl-san, could you take a look? I guess that this is a bug of Gmail because I cannot reproduce this with contenteditable
without any script.
Comment 3•4 years ago
|
||
on macOS
- Have an image on the Desktop
- Select the image by tapping it once or clicking it once (image is highlighted)
- Command C to copy the image.
- Open the notes.app
- in a new note, command V to paste the image (image appears in the note)
- Open Firefox Nightly 89.0a1 (2021-03-22) Clean Profile
- go to mail.google.com (eventually log in)
- Compose new message (a small window appears at the bottom right of your screen)
- Put the cursor in the body area of the composition window
- Command V to paste the image (an image appears in the body)
So no issue for me too. This is working as intended.
Let see if oana can reproduce on the same browser version with windows.
Here is a video demo of the issue.
Tested again on "Private browser", with no cookies or cache, and all Firefox plugins disabled.
The issue is still present.
Thank you for helping! :)
Comment 5•4 years ago
|
||
Ah understood. I can reproduce.
This is happening only if the screenshot to clipboard is done.
Not going through a copy - paste sequence
I wonder what are the differences in between the two.
So on macos to reproduce, you may for example when taking the screenshot do command + shift + 5, then select capture with the option to the clipboard.
paste
event is the same in both cases with identical clipboardData
as far as I can tell. There is an interesting difference of behavior.
Copy-Paste -> Add the name of the file, and the content of the image
Screenshot-Clipboard-Paste -> Add twice the image but no name of the file.
Comment 6•4 years ago
|
||
q0d = function (c, d) {
return function h(f, g) {
g = void 0 === g ? !0 : g;
var l = d;
f
here is the event you can log f
with the condition f.type === 'paste'
in gmail code there is And it goes through, and it seems to do the same thing in both cases.
F$h.prototype.aib = function (c) {
var d = c.Hf().clipboardData;
if (d) {
var e = d.items;
if (e && 1 < e.length) {
e = _.Oo(e, function (h) {
return h.kind == _.Ai && _.jIg.includes(h.type)
});
var f = d.getData(_.qya);
d = d.getData(_.Bn);
var g;
if (g = e) {
if (!(f = f && G$h(this, f)) && (f = d)) try {
f = H$h.has(_.cA(d).wa)
} catch (h) {
f = !1
}
g = f
}
if (g) {
e = e.getAsFile();
if (this.ha.Cd(e)) return c.preventDefault(),
!0;
this.ha.ha.execCommand(_.hIg, e);
c.preventDefault();
return !0
}
}
}
return !1
};
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Reproducible on Ubuntu too:
<div id=":sy" class="Am Al editable LW-avf tS-tW tS-tY" hidefocus="true" aria-label="Message Body" g_editable="true" role="textbox" aria-multiline="true" style="direction: ltr; min-height: 40px;" tabindex="1" spellcheck="false" contenteditable="true">
<img data-surl="cid:ii_kmn6si290" src="blob:https://mail.google.com/bd9273f4-2ca1-492c-8ed9-2b37fd12b449" alt="image.png" width="150" height="82">
<br>
<img data-surl="cid:ii_kmn6si2u1" src="blob:https://mail.google.com/817a55a6-7b2a-4c51-9dfa-77a06d108b01" alt="image.png" width="150" height="82"><br><br>
</div>
Assignee | ||
Comment 8•4 years ago
•
|
||
While trying to figure out which code-paths in Gecko are taken, I've noticed
PasteCommand::DoCommand
is called, but is a no-op because TextEditor::PasteAsAction returns early
.
When pasting to <div contenteditable>
, where the issue doesn't occur, TextEditor::PasteAsAction does not return early and proceeds with pasting
.
Assignee | ||
Comment 9•4 years ago
|
||
Interestingly, after pasting an image to Gmail in Chrome, I can't undo the pasting. That works in Firefox.
Assignee | ||
Comment 10•4 years ago
|
||
With
var oldEPD = Event.prototype.preventDefault;
Event.prototype.preventDefault = function() {
debugger;
oldEPD.call(this);
};
(thanks to this stackoverflow post)
one can observe that preventDefault()
is called for some paste
events, which might be Gmail's code.
Assignee | ||
Comment 11•4 years ago
|
||
Notified Google developers about this issue. Let's see if they can help determining whether the bug is in Gmail or Gecko.
Updated•4 years ago
|
Assignee | ||
Comment 13•4 years ago
|
||
A Google developer confirmed the bug is in Gmail's code. They have fixed the issue and are going to rollout it as part of their standard release procedure. Once it's clear when that fix will reach all end users, we should verify it and close this ticket.
Comment 14•4 years ago
|
||
Can confirm it happening on firefox 87.0 64 bit on windows 10. This has been going on for at least 10 days.
Comment 15•4 years ago
|
||
Relieved it's not an issue with my vision or medication
Comment 16•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) -- away until 7th of April 2021 from comment #13)
A Google developer confirmed the bug is in Gmail's code. They have fixed the issue and are going to rollout it as part of their standard release procedure. Once it's clear when that fix will reach all end users, we should verify it and close this ticket.
Occurs in Chrome 89.0.4389.90 as well.
Comment 17•4 years ago
|
||
Hello! Unfortunatelly I wasn't able to reproduce the issue with the Firefox 86.0.1 with the STR provided. However since the issue is a Google issue I can confirm that it doesn't occur anymore with firefox 86.0.1, 87.0, 88.0b9 and 89.0a1 on all OS's. I also verified the issue with the latest Google Chorme (89.0.4389.114) 64 bit release and it isn't reproducing anymore.
I will mark this issue as as resolved WORKSFORME, if it's not the right resolution please reopen this issue.
Thank you!
Comment 18•4 years ago
|
||
I still have this issue - Firefox 87 on Windows 10.
Comment 19•4 years ago
|
||
I confirm that I still have the issue:
Firefox 87 on Ubuntu 20.04.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 20•4 years ago
•
|
||
Couldn't reproduce the issue with current Nightly on Ubuntu 20.04. But will keep the ticket open for now.
Reporter | ||
Comment 21•4 years ago
|
||
The issue is resolved for me (original poster), I'm still on Windows10Pro 64bit, but I did upgrade to Firefox v87.0
Can't speak to Ubuntu users, but I hope that info helps someone.
Thank you all again!
Assignee | ||
Comment 22•4 years ago
|
||
:sjperry, :gianni: does the issue still occur for you? If so, can you please try refreshing Gmail and if that doesn't work, clearing the cache?
Comment 23•4 years ago
|
||
Thanks for asking, the issue is fixed on Firefox 87 on Ubuntu 20.04, tomorrow I'll test in on windows 10
Comment 24•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #22)
:sjperry, :gianni: does the issue still occur for you? If so, can you please try refreshing Gmail and if that doesn't work, clearing the cache?
No it does not. Just tested in Firefox 87 on two Windows 10 machines and pasting image into Gmail works correctly now.
Comment 25•4 years ago
|
||
Tested with Firefox 87 on Ubuntu 20.04, Windows 10, Windows server 2012 and 2016, MacOS Big Sur.
No bug anymore. I consider it as fixed. thx.
Assignee | ||
Updated•4 years ago
|
Comment 26•4 years ago
|
||
I have this bug in the last version of Firefox, 89.0.
Comment 27•4 years ago
|
||
no problem here (I had it in the past)
firefox 89 on ubuntu 20.04
Reporter | ||
Comment 28•4 years ago
|
||
I can't replicate the issue, it's still fixed for me.
Windows 10 Pro 64bit, Firefox 88.0.1 (64-bit).
Comment 29•4 years ago
|
||
I have also this issue, when using the built in Windows 10 snap tool or using the free Greenshot tool.
When I paste the image in our BMS or IT Glue tools, I get the pasted image twice.
If i test the same sequense in Edge: no problems.
No issues with GMail...
FF version: 89.0 (64-bits) Dutch
Assignee | ||
Comment 30•4 years ago
|
||
ndaltamirano, martijn_online: thanks for your feedback. Forwarded this to Gmail developers.
ndaltamirano: which OS were you using?
Comment 31•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #30)
ndaltamirano, martijn_online: thanks for your feedback. Forwarded this to Gmail developers.
ndaltamirano: which OS were you using?
I'm using W10.
Assignee | ||
Comment 32•4 years ago
|
||
(In reply to ndaltamirano from comment #31)
(In reply to Mirko Brodesser (:mbrodesser) from comment #30)
ndaltamirano, martijn_online: thanks for your feedback. Forwarded this to Gmail developers.
ndaltamirano: which OS were you using?
I'm using W10.
Thanks.
Just to be sure: does the issue indeed occur on Gmail?
Comment 33•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #32)
(In reply to ndaltamirano from comment #31)
(In reply to Mirko Brodesser (:mbrodesser) from comment #30)
ndaltamirano, martijn_online: thanks for your feedback. Forwarded this to Gmail developers.
ndaltamirano: which OS were you using?
I'm using W10.
Thanks.
Just to be sure: does the issue indeed occur on Gmail?
No. It occurs whenever I copy and paste an image from Firefox to some websites in Chrome.
You can try it by using https://keep.google.com. Copy an image from Firefox, and paste it in a note in there.
I can also reproduce this on WhatsApp web, and Facebook Messenger.
It seems the problem is copying from Firefox, and pasting into Chrome.
This wasn't happening on the previous version, before the new Firefox UI was rolled out.
Comment 34•4 years ago
|
||
Also, this is a recurring use case for me, because I use Firefox as my browser, and also use All-In-One messenger, which is based on Chrome.
Comment 35•4 years ago
|
||
Copy pasta problem confirmed on firefox 89.0 and chrome 91 on windows 10.
In firefox, right click to copy an image.
Go to https://imgur.com/upload
press Ctrl+V
The image gets pasted twice.
Assignee | ||
Comment 36•4 years ago
|
||
(In reply to ndaltamirano from comment #33)
(In reply to Mirko Brodesser (:mbrodesser) from comment #32)
(In reply to ndaltamirano from comment #31)
(In reply to Mirko Brodesser (:mbrodesser) from comment #30)
ndaltamirano, martijn_online: thanks for your feedback. Forwarded this to Gmail developers.
ndaltamirano: which OS were you using?
I'm using W10.
Thanks.
Just to be sure: does the issue indeed occur on Gmail?No. It occurs whenever I copy and paste an image from Firefox to some websites in Chrome.
You can try it by using https://keep.google.com. Copy an image from Firefox, and paste it in a note in there.
I can also reproduce this on WhatsApp web, and Facebook Messenger.
It seems the problem is copying from Firefox, and pasting into Chrome.
This wasn't happening on the previous version, before the new Firefox UI was rolled out.
The issue didn't reproduce with Ubuntu 20.04.
Assignee | ||
Comment 37•4 years ago
|
||
(In reply to gianni from comment #35)
Copy pasta problem confirmed on firefox 89.0 and chrome 91 on windows 10.
Instead of "chrome 91", do you mean "Nightly 91"?
In firefox, right click to copy an image.
Go to https://imgur.com/upload
press Ctrl+V
The image gets pasted twice.
The issue didn't reproduce on Ubuntu 20.04.
Assignee | ||
Comment 38•4 years ago
|
||
For issues with other websites than Gmail, please file separate tickets.
Comment 39•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #38)
For issues with other websites than Gmail, please file separate tickets.
The issue is not with specific websites, it's with Chrome.
Assignee | ||
Comment 40•4 years ago
|
||
(In reply to ndaltamirano from comment #39)
(In reply to Mirko Brodesser (:mbrodesser) from comment #38)
For issues with other websites than Gmail, please file separate tickets.
The issue is not with specific websites, it's with Chrome.
Sorry, should've been clearer: for clipboard image pasting bugs happening not only on Gmail, please file separate tickets. This ticket was about a Gmail-specific bug.
Comment 41•4 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #40)
(In reply to ndaltamirano from comment #39)
(In reply to Mirko Brodesser (:mbrodesser) from comment #38)
For issues with other websites than Gmail, please file separate tickets.
The issue is not with specific websites, it's with Chrome.
Sorry, should've been clearer: for clipboard image pasting bugs happening not only on Gmail, please file separate tickets. This ticket was about a Gmail-specific bug.
Ok, I just did. Not sure if there's any mistake on the report. If so, could you please repost it as it should be?
Description
•