Patch #32596
closedfix image pasting for Edge
0%
Description
The attached patch courtesy of Planio fixes image pasting for Edge (without breaking it for other browsers) by constructing a Blob
instead of a File
in the paste handler.
I also amended the detailed help files where a note that IE and Edge are not supported has recently been added (#32552). Lacking the language skills I did not change the japanese files, that would still have to be done.
Files
Related issues
Updated by Yuichi HARADA almost 5 years ago
Jens Priesen Krämer, thank you for providing a great patch. However, nothing is displayed on the preview screen immediately after the image is pasted (all of the browsers except IE).
If you add the following patch together, it will work.
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 645038284..053ef076a 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -103,7 +103,7 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
}, options);
uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
- if (blob instanceof window.File) {
+ if (blob instanceof window.Blob) {
uploadUrl += '&filename=' + encodeURIComponent(blob.name);
uploadUrl += '&content_type=' + encodeURIComponent(blob.type);
}
Updated by Jens Krämer almost 5 years ago
- File 0001-fixes-image-pasting-for-Edge-3816-32552.patch 0001-fixes-image-pasting-for-Edge-3816-32552.patch added
Thanks for pointing this out! Attached is a new patch including the above fix.
Updated by Marius BĂLTEANU almost 5 years ago
- Related to Patch #32552: Clarify that pasting images from clipboard does not support Internet Explorer added
Updated by Marius BĂLTEANU almost 5 years ago
- Related to Feature #3816: Allow pasting screenshots from clipboard added
Updated by Marius BĂLTEANU almost 5 years ago
- Target version set to Candidate for next major release
Thanks Jens and Yuichi for fixing this issue on Edge. I propose to commit this as part of the related issues.
Updated by Go MAEDA almost 5 years ago
- Category set to Attachments
- Status changed from New to Closed
- Target version deleted (
Candidate for next major release)
Committed the fix. Thank you for improving the feature.