This is a migrated thread and some comments may be shown as answers.

Access Denied error when document.domain is set.

4 Answers 160 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 01 Oct 2013, 07:39 PM
I am working in an application where it is necessary to set  document.domain. This is non-negotiable. When document.domain is set and I am using localhost or a FQDM then I get an "Access Denied" error from Kendo. It has something to do with creating or accessing the iframe for the editor. The error occurs on line 301 of kendo.editor.js:

295     iframe = $("<iframe />", { src: 'javascript:""', frameBorder: "0" })
296                        .css("display", "")
297                        .addClass("k-content")
298                        .insertBefore(textarea)[0];
299    
300     wnd = iframe.contentWindow || iframe;
301     doc = wnd.document || iframe.contentDocument;

You can reproduce this issue by taking the editor demo (found here: examples\web\editor\index.html) and adding the following script tag at the end of the head:
<script>document.domain=document.domain;</script>
Setting the document.domain after the editor is initialized obviously works but probably wont always be an option. How can I get the editor to work after document.domain is set?

This occurs in IE 8 & 9. The version of Kendo I am using is 2013.2.716.

4 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 02 Oct 2013, 01:38 PM
Hello Erik,

 I have replied to your stackoverflow question: http://stackoverflow.com/questions/19137006/access-denied-error-when-document-domain-is-set/19138094#19138094

 We will see if we can fix this problem in the case when iframe is used.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Erik
Top achievements
Rank 1
answered on 02 Oct 2013, 03:09 PM
Are you going to open a bug or feature request or did you want me to? If you open one can you send me a link so that I can track it? If you want me to open it then how would I go about doing that?
0
Atanas Korchev
Telerik team
answered on 02 Oct 2013, 03:11 PM
Hello Erik,

 I have opened a bug report but there is no way it can be tracked. We will update this thread once there is any progress.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Alex Gyoshev
Telerik team
answered on 03 Oct 2013, 10:42 AM
Hello Erik,

I am glad to inform you that the problem has been fixed in the upcoming internal build. Please note that the provided fix will not work with the line document.domain = document.domain, but will work if the same-origin policy is actually relaxed (i.e., setting "kendoui.com" on a page in "docs.kendoui.com").

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Erik
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Erik
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or