Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5043 closed Bug (fixed)

Javascript code appended to the content of the editor

Reported by: Diego Caravana Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: CKEditor 3.2
Component: General Version: 3.1
Keywords: Review+ Cc: diego@…

Description

Sometimes the following code is appended to the content of the editor:

 <script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR._["contentDomReadyeditor"](window);</script>

In my case, I save the content to the database to be used in a different context than a browser so the script tag creates a problem; in any case it should not be part of the real (user) content.

The conditions that cause this behavior are not clear at present time.

See #4455.

Attachments (1)

5043.patch (701 bytes) - added by Frederico Caldeira Knabben 8 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Pending added

We should really try to come out with a test case for this issue.

Other than that, do you have any JavaScript error when this happens?

Changed 8 years ago by Frederico Caldeira Knabben

Attachment: 5043.patch added

comment:2 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Pending removed
Owner: set to Frederico Caldeira Knabben
Status: newassigned

I'm proposing a patch that should solve the problem. In any case, it's correct to have that attribute added.

To test the effectiveness of the patch, it's enough to comment out line 360 in the wysiwygarea plugin. In this way, the script is not removed from the DOM.

But, we're still not able to reproduce your original issue here, so we can't confirm it fixes it. Because of this, a test case would still be useful for testing.

You may also wait and simply test it from the nightly build as soon as the fix gets committed.

comment:3 Changed 8 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.2

comment:4 Changed 8 years ago by Diego Caravana

I've asked my team to try to find the test case for this problem; afterwards, I could apply the patch and try it.

comment:5 Changed 8 years ago by Diego Caravana

To help finding the test case, can you please explain a bit when that code is inserted? In relation to what events (e.g. copy and paste, style change, etc)?

comment:6 in reply to:  5 Changed 8 years ago by Frederico Caldeira Knabben

Replying to dcaravana:

To help finding the test case, can you please explain a bit when that code is inserted? In relation to what events (e.g. copy and paste, style change, etc)?

That's the code that loads the editor contents in the editing area (when creating an editor or switching back from source view). It not only loads it, but also removes the <script> tag (which seems to not happen in your case).

comment:7 Changed 8 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review- added; Review? removed

I think that we really need a testcase here. The patch just hides the script from the final output, but if it exist it means that there has been some error executing the contentDomReady function as cleaning the script is one of the first steps executed, and there might be other strange problems that we are not aware of if this symptom is hidden.

comment:8 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Review- removed

I agree with you Alfonso, but considering that we don't have a TC, it's a pity to miss this small change, which will at least prevent having one of the possible issues related to the execution error. After all, the change fixes "exactly" what's reported here. We may have other tickets for the other symptoms of it.

comment:9 Changed 8 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review+ added; Review? removed

comment:10 Changed 8 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

Fixed with [5021].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy