Opened 11 years ago

Last modified 11 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:

  1. Open http://nightly.ckeditor.com/13-07-23-13-05/standard/samples/replacebyclass.html
  2. Hover any link in the editable content with the mouse pointer.
  3. Click the hovered link.

What should happen (as it does in, for example, Firefox 22.0):

  1. The cursor icon should be «text».
  2. The link should not open, the input caret should move to the clicked point.

What happens:

  1. The cursor is «pointer» (checked in qtwebkit).
  2. 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)

102.png (97.2 KB) - added by Сковорода Никита Андреевич 11 years ago.
A screenshot of the bug

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Сковорода Никита Андреевич

Attachment: 102.png added

A screenshot of the bug

comment:1 Changed 11 years ago by Сковорода Никита Андреевич

This is also valid for 4.2.0 release and 4.0 release.

comment:2 Changed 11 years ago by Jakub Ś

Keywords: iOS added; links removed

NOTE: We don't support qtwebkit. From Webkit based browsers we support Safari.

comment:3 Changed 11 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.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy