Opened 11 years ago
Last modified 11 years ago
#11649 closed Bug
node.js: cross domain getPrarent() permission access denied error — at Version 2
Reported by: | Feng | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description (last modified by )
Hi CKEditor team,
So we iframed a page using CKEditor in another page with different domain. Since getParent() in core/dom/noide.js could try to access the parent of this.$ (which could be a "document" level node) that will give access denied permission error.
I would suggest below code:
getParent: function( allowFragmentParent ) { var parent; try{ parent = this.$.parentNode; } catch(err){ //for no permission to access the parentNode parent = null; } return ( parent && ( parent.nodeType == CKEDITOR.NODE_ELEMENT || allowFragmentParent && parent.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ) ) ? new CKEDITOR.dom.node( parent ) : null; },
Change History (2)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Version: | 4.3.2 |
I messed up the format above. The wikiFormatting doesn't take {code} marcos. :(
This is what I mean:
This might not be the best solution. If we could handle "parentNode" more gracefully then it would be even better.