Opened 12 years ago
Last modified 12 years ago
#10669 new Bug
CKEditor follows links in WebKit-based browsers, replacing the iframe content
| Reported by: | Сковорода Никита Андреевич | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 4.2.1 |
| Keywords: | iOS | Cc: |
Description
Tested under qtwebkit 2.3.1, qtwebkit 2.3.2, qt5-webkit from Qt 5.1.0, and Safari on iPad.
Steps to reproduce:
- Open http://nightly.ckeditor.com/13-07-23-13-05/standard/samples/replacebyclass.html
- Hover any link in the editable content with the mouse pointer.
- Click the hovered link.
What should happen (as it does in, for example, Firefox 22.0):
- The cursor icon should be «text».
- The link should not open, the input caret should move to the clicked point.
What happens:
- The cursor is «pointer» (checked in qtwebkit).
- The link opens in the editor iframe and replaces all the content, resulting in data loss.
Workaround (jQuery-based):
/// WARNING: bloody fix for WebKit-based browsers
CKEDITOR.on('instanceReady', function(ev) {
if (!CKEDITOR.env.webkit) return;
function disableLinks() {
var content = $(ev.editor.document.$.defaultView.frameElement).contents();
content.find('body.cke_editable').on('click', 'a', function() {
return false;
});
content.find('head').append('<style>a{cursor:text}</style>');
}
ev.editor.on('mode', function() {
if (this.mode === 'wysiwyg')
disableLinks();
});
disableLinks();
});
Attachments (1)
Change History (4)
Changed 12 years ago by
comment:2 Changed 12 years ago by
| Keywords: | iOS added; links removed |
|---|
NOTE: We don't support qtwebkit. From Webkit based browsers we support Safari.
comment:3 Changed 12 years ago by
If you will be testing this under Safari on iOS 7, you will notice that Safari crashes upon clicking on a link in an editor on the demo pages.
The crash is not directly related to CKEditor, it is a result of a Safari bug (afaik, on iOS 7 only), which crashes from <iframe src="http://en.wikipedia.org/wiki/Neil_Armstrong" width="100" height="100"></iframe> (might be device-dependant).
But CKEditor should not follow the clicked link.

A screenshot of the bug