Opened 11 years ago

Closed 10 years ago

#10563 closed Bug (wontfix)

CKeditor 4.1.2: Access denied error in IE7

Reported by: Cédric Delécluse Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1.2
Keywords: IE7 Cc:

Description

Hello,

In my site I have this code in the page's header:

<script type="text/javascript">
   document.domain = mysite.com
</script>

I have a "Access denied" error with IE7 even if I add this line :

CKEDITOR.tools.fixDomain(true);

before :

CKEDITOR.replace(
        'detail',
        {
            width: '430px',
            height:'200px',	
        }
    );

To correct the problem I forced the domain in all cases. In core/tools.js, function fixDomain() I have added:

try {
   // Try to access the parent document. It throws
   // "access denied" if restricted by the "Same Origin" policy.
   domain = window.parent.document.domain;
   
   // Here I force the domain
   document.domain = domain;
   break;
} catch ( e ) {
...

And now it's ok for me, I don't have "Access denied".

Change History (3)

comment:1 Changed 11 years ago by Jakub Ś

This is probably continuation of 10165-comment:28. To reproduce this problem I have:

  • Set up domain sub.example.com.
  • I have put CKEditor under this domain
  • On sample page replacebycode.html I have set document.domain='sub.example.com'; which is the same as current domain
  • Next I have loaded page http://sub.example.com/ckeditor/samples/replacebycode2.html

Result: Access denied is thrown. Seems when domain set to the same value as actual domain is causing problems in IE7. I know editor sets document.domian for content area which is in iframe. Perhaps it doesn't do it when domain are the same and IE7 needs such setting.


NOTE:
The above is the only case that doesn't work. In ticket #10165 this issue was fixed probably all other cases e.g.

  • I have tried from example.com level calling page (in iframe) which is under sub.example.com and has document.domain=example.com set. Works.
  • I have also tired calling this page, located under sub.example.com, directly i.e URL is http://sub.example.com/editor.html and page has document.domain=example.com set. Works as well.

Useful link: http://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do

Last edited 11 years ago by Jakub Ś (previous) (diff)

comment:2 Changed 11 years ago by Jakub Ś

Keywords: IE7 added
Status: newconfirmed

comment:3 Changed 10 years ago by Jakub Ś

Resolution: wontfix
Status: confirmedclosed

We have dropped support for IE7 so I'm closing this ticket.

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