Pasting text from Word 2016 on macOS includes transparent PNG in the DataTransfer object when no image was copied
Reported by
mich...@mbates.co,
Jun 2 2017
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Steps to reproduce the problem: 1. Copy any plain text from Word 2016 2. Setup a page to get the output of event.clipboardData.files in a 'paste' event handler 3. The files array will contain one File, even though none was copied from Word 2016 What is the expected behavior? The files array should be empty as no image was copied What went wrong? This only happens on macOS. Tested on Firefox and Safari and the result is the expected behaviour (empty files array). See here for an example fiddle: https://jsfiddle.net/9gnoxhng/1/ Did this work before? N/A Chrome version: 58.0.3029.110 Channel: stable OS Version: OS X 10.12.4 Flash Version:
,
Jun 2 2017
,
Jun 5 2017
What are the properties of the file? (type, size, content, ... ?)
,
Jun 6 2017
According to the logged FileList array in the provided fiddle, these are the properties: lastModified: 1496708737117 lastModifiedDate: Tue Jun 06 2017 10:25:37 GMT+1000 (AEST) name: "image.png" size: 307 type: "image/png" webketRelativePath: "" The size seems to increase as more text is pasted (I just pasted a blank space from Word and got size 307, if I paste a sentence such as "This is a test" the size is 788. lastModified and lastModifiedDate are the current date and time when the text is pasted.
,
Jun 6 2017
I wonder what the image is - maybe Word is putting a screenshot of the doc on the pasteboard! (Sorry, don't have MacOS+Word handy to test myself at the moment)
,
Jun 6 2017
Looks like you are correct, this updated fiddle creates an <img> object with the src set to the data url of the pasted file object. The image contains the text that was just pasted. I wonder why this doesn't happen on Windows? https://jsfiddle.net/9gnoxhng/2/
,
Jun 7 2017
+pwnall@chromium.org - can you attempt to reproduce this on a Mac?
,
Jun 7 2017
I got this with Word 2011 (14.7.4) and Word 2016 (15.34). I tried copy-pasting "Some random text in a sentence." Office 2011 creates a 1397-byte file, Office 2016 creates a 1421-byte file. I'm guessing we do this because we see an image on the clipboard, and our heuristics decide we should add an image file. FWIW, Firefox 53.0.3 and Safari TP 31 don't do this. I've attached the pasteboard types as shown by Clipboard Viewer at https://developer.apple.com/library/content/samplecode/ClipboardViewer/Introduction/Intro.html
,
Jun 8 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 18 2018
Still repros on Chrome 69.0.3464.0 with Word 16.14.1. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by dglazkov@chromium.org
, Jun 2 2017Status: Untriaged (was: Unconfirmed)