Closed
Bug 1354452
Opened 8 years ago
Closed 8 years ago
When copying HTML fragment containing text and embedded cid: image, no "text only" flavour is placed onto the clipboard (HTML flavour only) - Copying text and image doesn't paste text into Notepad
Categories
(Thunderbird :: Message Reader UI, defect)
Tracking
(thunderbird_esr5253+ fixed, thunderbird53 fixed, thunderbird54 fixed, thunderbird55 fixed)
RESOLVED
FIXED
Thunderbird 55.0
People
(Reporter: petr, Assigned: jorgk-bmo)
References
Details
Attachments
(4 files, 1 obsolete file)
(deleted),
image/png
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
jorgk-bmo
:
review+
jorgk-bmo
:
approval-comm-aurora+
jorgk-bmo
:
approval-comm-esr52+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Steps to reproduce:
Open mail in html format with included images (ex. company logo in signature). Press Ctrl+A then Ctrl+C to copy whole mail. Run notepad.exe and press Ctrl+V
Actual results:
Mail plain text is not copied.
Expected results:
Copy plain text of mail to notepad.
Comment 1•8 years ago
|
||
Same thing in safe mode?
https://support.mozilla.org/en-US/kb/safe-mode-thunderbird
If works in safe mode, please determine which addon is at fault, post the name here, and notify the author of the addon
Component: Mail Window Front End → Message Reader UI
OS: Unspecified → Linux
Comment 3•8 years ago
|
||
Does bug 1235454 also happen for you?
Does it seem like same problem?
Yes, bug 1235454 also happen in Thunderbird 52.0.
But it seems like other problem. In compose window select all and copy text works. While reading incoming emails, not all formats are copied to windows clipboard.
Comment 6•8 years ago
|
||
I can confirm this Bug.
Select some text with the picture.
copy and paste -> result: no text is pasted
Regression window:
Last good:
Thunderbird (52.0a1) - Daily BuildID=20161109190331
Rev: Comm-Central:dc1b2bd19227 / Mozilla-Central:336759fad462
First bad:
Thunderbird (52.0a1) - Daily BuildID=20161112064932
Rev: Comm-Central:228b399d8933 / Mozilla-Central:fc104971a4db
Assignee | ||
Comment 7•8 years ago
|
||
Caused by bug 1315480.
Use FreeClipViewer.exe to see the clipboard. When copying from the message in attachment 8855853 [details] I get this clipboard on Windows:
<html><body>
<!--StartFragment-->HTML <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAA0UlEQVQokYWTsQ3EIAxFM2FWyBYUrEHDGu7TWkrNAAiJIj0N5b/iZB9xEs6IAsHj+2O8YBKUCaXVx71lXHR0lFZxnAzKBMceIUV09DlYWgVlAmVCSBEhRTj2qlpa1UsuoCiNoCiGFLHum140VXTsdb3um07H/gv2YYiqqIlXx/4CL3J4nDbVR1BecfRn030ExZsFrZqURvZfwSdFgbUcFjxORmn1NdWQ4u9VxacU+Tj5v0cbUs83UD3akHTHGjr2mtHty41q9kPYLrl1x6yVxvgAgFf0dZrumY4AAAAASUVORK5CYII=" alt="" shrinktofit="true">
with picture<!--EndFragment-->
</body>
</html>
That pastes perfectly into a new message. It doesn't paste into Notepad++, it pastes into LibreOffice with the image and into MS Office without the image.
Further analysis: When copying this in TB 45.x, you get a flavour "Unicode Text Format" on the clipboard, which is what Notepad++ will paste. When using TB 52, there is no such flavour.
Looks like we lost the "Unicode Text Format" flavour. Magnus, can you please take a look.
Workaround: View the message as plain text if you want to copy to Notepad.
Assignee | ||
Updated•8 years ago
|
Summary: Copy mail text → When copying HTML fragment containing text and embedded cid: image, no "text only" flavour is placed onto the clipboard (HTML flavour only) - Copying text and image doesn't paste text into Notepad
Assignee | ||
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 8•8 years ago
|
||
When copying text and image from a web page, this problem doesn't occur.
So the problem is caused by TB when converting the internal mailnews URL (mailbox:// or imap://) to a data: URL:
https://hg.mozilla.org/comm-central/rev/c8666b9f31bc868950a698b2cc28896d45a09030#l1.81
I'll get this fixed right now.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Flags: needinfo?(mkmelin+mozilla)
Assignee | ||
Comment 9•8 years ago
|
||
Magnus regressed this, but with 17 reviews in the queue he's not the best reviewer here I'm afraid.
Attachment #8855913 -
Flags: review?(mkmelin+mozilla)
Attachment #8855913 -
Flags: review?(acelists)
Comment 10•8 years ago
|
||
Comment on attachment 8855913 [details] [diff] [review]
1354452-set-plain-flavour.patch (v1).
Review of attachment 8855913 [details] [diff] [review]:
-----------------------------------------------------------------
Thx! r=mkmelin
::: mail/base/content/mailWindow.js
@@ +126,5 @@
> }
>
> let html = div.innerHTML;
> + let parserUtils = Cc["@mozilla.org/parserutils;1"]
> + .getService(Components.interfaces.nsIParserUtils);
Commponets.classes instead of Cc
@@ +128,5 @@
> let html = div.innerHTML;
> + let parserUtils = Cc["@mozilla.org/parserutils;1"]
> + .getService(Components.interfaces.nsIParserUtils);
> + let plain = parserUtils.convertToPlainText(html,
> + Components.interfaces.nsIDocumentEncoder.OutputSelectionOnly, 0);
OutputSelectionOnly looks wrong
OutputForPlainTextClipboardCopy maybe?
Attachment #8855913 -
Flags: review?(mkmelin+mozilla)
Attachment #8855913 -
Flags: review?(acelists)
Attachment #8855913 -
Flags: review+
Assignee | ||
Comment 11•8 years ago
|
||
Hey, that was quick ;-) Cc works, but I can change it.
OutputSelectionOnly is widely used and works:
https://dxr.mozilla.org/comm-central/search?q=nsIDocumentEncoder.OutputSelectionOnly&redirect=false
https://dxr.mozilla.org/comm-central/search?q=nsIDocumentEncoder%3A%3AOutputSelectionOnly&redirect=false
But you're right, the other one is used, too. I'll try it:
https://dxr.mozilla.org/comm-central/search?q=OutputForPlainTextClipboardCopy&redirect=false
Assignee | ||
Comment 12•8 years ago
|
||
Issued fixed.
Attachment #8855913 -
Attachment is obsolete: true
Attachment #8855931 -
Flags: review+
Assignee | ||
Comment 13•8 years ago
|
||
Sign, too fast, issues fixed.
Assignee | ||
Comment 14•8 years ago
|
||
https://hg.mozilla.org/comm-central/rev/b8c745f4d6b49198780f5ff79bb4c32ff5de599b
BTW, I tested this with a 300KB e-mail with lots of images and text. Worked fine.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 55.0
Assignee | ||
Comment 15•8 years ago
|
||
Comment on attachment 8855931 [details] [diff] [review]
1354452-set-plain-flavour.patch (v2).
[Approval Request Comment]
Regression caused by (bug #): Bug 1315480.
User impact if declined: No plain text flavour, so can't copy certain e-mails to a text editor.
Testing completed (on c-c, etc.): Manual.
Risk to taking this patch (and alternatives if risky): Not risky.
Attachment #8855931 -
Flags: approval-comm-esr52?
Attachment #8855931 -
Flags: approval-comm-beta+
Attachment #8855931 -
Flags: approval-comm-aurora+
Assignee | ||
Comment 16•8 years ago
|
||
Aurora (TB 54):
https://hg.mozilla.org/releases/comm-aurora/rev/bd921bdc8b03b3bef9c79733117f531acdb9eba3
status-thunderbird53:
--- → wontfix
status-thunderbird54:
--- → fixed
status-thunderbird55:
--- → fixed
status-thunderbird_esr52:
--- → affected
Assignee | ||
Updated•8 years ago
|
Attachment #8855931 -
Flags: approval-comm-beta+
Assignee | ||
Comment 17•8 years ago
|
||
Beta (TB 53) - landed for SM:
https://hg.mozilla.org/releases/comm-beta/rev/5bad40c77beca9d1c94c6355a0869a3e426f8ce6
Updated•7 years ago
|
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 18•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8855931 -
Flags: approval-comm-esr52? → approval-comm-esr52+
Assignee | ||
Updated•7 years ago
|
tracking-thunderbird_esr52:
--- → 53+
You need to log in
before you can comment on or make changes to this bug.
Description
•