[CKEditor Dev] #13029: [Safari] Pasting fragment of an image does not trigger its upload

37 views
Skip to first unread message

CKEditor

unread,
Mar 11, 2015, 5:36:30 AM3/11/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
---------------------+------------------------------------
Reporter: Reinmar | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 (GitHub - major)
Keywords: |
---------------------+------------------------------------
1. Open
http://tests.ckeditor.dev:1030/tests/plugins/uploadwidget/manual/image
2. Open an image in Preview.
3. Select part of it and copy.
4. Paste it into the editor.

Pasted image wasn't uploaded. In the data we can find `<img src="webkit-
fake-url://e303f4ea-3e1d-4c51-a83d-52707aeeb397/image.tiff" />`

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029>
CKEditor <http://ckeditor.com/>
The text editor for the Internet

CKEditor

unread,
Mar 11, 2015, 8:43:54 AM3/11/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
----------------------+------------------------------------
Reporter: Reinmar | Owner:
Type: Bug | Status: confirmed

Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 (GitHub - major)
Resolution: | Keywords:
----------------------+------------------------------------
Changes (by pjasiun):

* status: new => confirmed


--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:1>

CKEditor

unread,
Mar 12, 2015, 6:37:12 AM3/12/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
----------------------+------------------------------------
Reporter: Reinmar | Owner:
Type: Bug | Status: confirmed

Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 (GitHub - major)
Resolution: | Keywords:
----------------------+------------------------------------
Changes (by Reinmar):

* milestone: CKEditor 4.5.0 Beta => CKEditor 4.5.0


--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:2>

CKEditor

unread,
May 4, 2015, 5:49:25 AM5/4/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
----------------------+----------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned

Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 Beta
Resolution: | Keywords:
----------------------+----------------------------
Changes (by a.nowodzinski):

* owner: => a.nowodzinski
* status: confirmed => assigned


--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:3>

CKEditor

unread,
May 4, 2015, 6:54:40 AM5/4/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
----------------------+----------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 Beta
Resolution: | Keywords:
----------------------+----------------------------

Comment (by Reinmar):

The first step here is to research if it is possible in any way to get
that image. It may happen that it is not and then we'll just drop this
ticket.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:4>

CKEditor

unread,
May 4, 2015, 6:57:11 AM5/4/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
----------------------+----------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone: CKEditor 4.5.0
Component: General | Version: 4.5.0 Beta
Resolution: | Keywords:
----------------------+----------------------------

Comment (by a.nowodzinski):

Replying to [comment:4 Reinmar]:


> The first step here is to research if it is possible in any way to get
that image. It may happen that it is not and then we'll just drop this
ticket.

Yes. It was exactly my intention.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:5>

CKEditor

unread,
May 5, 2015, 7:33:37 AM5/5/15
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
-----------------------------+---------------------------

Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone:
Component: Core : Pasting | Version: 4.5.0 Beta
Resolution: | Keywords:
-----------------------------+---------------------------
Changes (by a.nowodzinski):

* component: General => Core : Pasting
* milestone: CKEditor 4.5.0 =>


Comment:

I've spent hours trying to access pasted image in Safari (8.0.5) but to no
avail. It's a well-known problem:

* https://bugs.webkit.org/show_bug.cgi?id=49141
* https://dev.ckeditor.com/ticket/8881
* http://stackoverflow.com/questions/4108459/javascript-webkit-fake-url
* https://pihole.wordpress.com/2012/04/12/webkit-fake-url-breaks-the-web/
(this one is desperate but I like it)

However it looks like Webkit team does not care.

----

= Strategies

== ClipboardData

I investigated using the following listener

{{{
editor.on( 'instanceReady', function() {
this.editable().$.addEventListener( 'paste', function( evt ) {
var types = evt.clipboardData.types;

for ( var i = 0; i < types.length; i++ ) {
console.log( 'types', types[ i ],
evt.clipboardData.getData( types[ i ] ), evt.clipboardData.getData( types[
i ] ).length );
}
}, false);
} );
}}}

which returns

{{{
types public.tiff 0

types image/tiff 0

types dyn.ah62d4rv4gu8zazwuqm10c6xemf1gq54uqm10c6xenv61a3k <?xml
version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>srcImageElementUUID</key>
<string>BB12DFD9-0BB6-49CA-A91C-916DF58F2AC9</string>
<key>sushi</key>
<false/>
<key>twoRepresentations</key>
<false/>
</dict>
</plist>
344

types PVPboardInfoPboardType 0
}}}

and this is the only information obtainable from the event (pretty
useless). I Googled to find some documentation about the mystic XML but
there is none.

== XHR

Any XHR request to `webkit-fake-url` fails with the following message:

{{{
XMLHttpRequest cannot load webkit-fake-url://848278f6-d10c-42fa-9f4a-
e3cb7c77849c/image.tiff. Cross origin requests are only supported for
HTTP.
}}}

so it's a dead end.

== Canvas

I tried to load the `webkit-fake-url` image into canvas (with
`canvas.drawImage()`), and then `canvas.toDataURL()` to obtain
base64-encoded image. It fails silently and the image is not loaded into
canvas.

I tried to bypass that problem by copying the image like

{{{
var imgCopy = new Image();
imgCopy.onload = function() {
// then try to draw imgCopy on canvas
};
imgCopy.src = webkitFakeUrlImg.src;
}}}

but just like XHR attempt, it ends up with same origin policy error.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:6>

CKEditor

unread,
Nov 10, 2016, 7:47:07 AM11/10/16
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
-----------------------------+---------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone:
Component: Core : Pasting | Version: 4.5.0 Beta
Resolution: | Keywords:
-----------------------------+---------------------------

Comment (by a.nowodzinski):

Webkit team has just closed the issue
https://bugs.webkit.org/show_bug.cgi?id=49141. There's a good chance we'll
be able to deal with this problem soon.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:7>

CKEditor

unread,
Nov 10, 2016, 7:53:11 AM11/10/16
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
-----------------------------+---------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone:
Component: Core : Pasting | Version: 4.5.0 Beta
Resolution: | Keywords:
-----------------------------+---------------------------

Comment (by a.nowodzinski):

Related Webkit issue https://bugs.webkit.org/show_bug.cgi?id=19893.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:8>

CKEditor

unread,
May 19, 2017, 1:49:14 PM5/19/17
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
-----------------------------+---------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone:
Component: Core : Pasting | Version: 4.5.0 Beta
Resolution: | Keywords:
-----------------------------+---------------------------

Comment (by blevine218):

Any update on this issue? I'm still seeing this issue when pasting images
into the editor in Safari. From the links posted above referencing the
associated webkit issues, the webkit issues appear to have been fixed. It
wasn't clear to me whether additional work needed to be done on the
CKEditor side.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:9>

CKEditor

unread,
Jul 4, 2017, 8:54:16 AM7/4/17
to ckeditor...@googlegroups.com
#13029: [Safari] Pasting fragment of an image does not trigger its upload
-----------------------------+---------------------------
Reporter: Reinmar | Owner: a.nowodzinski
Type: Bug | Status: assigned
Priority: Normal | Milestone:
Component: Core : Pasting | Version: 4.5.0 Beta
Resolution: | Keywords:
-----------------------------+---------------------------

Comment (by j.swiderski):

@blevine218 this issue is being continued on github. Please see:
https://github.com/ckeditor/ckeditor-dev/issues/466

--
Ticket URL: <http://dev.ckeditor.com/ticket/13029#comment:10>

Reply all
Reply to author
Forward
0 new messages