7

Was trying to write a snippet to demonstrate something with ckeditor today and encountered this message:

{
  "message": "SecurityError: Permission denied to access property \"document\" on cross-origin object",
  "filename": "https://cdn.ckeditor.com/4.8.0/standard/ckeditor.js",
  "lineno": 1190,
  "colno": 0
}

Is there a workaround to include CKEditor in a code snippet for the purposes of answering a question?

7
  • 3
    by the looks of it don't expect that to work. Stack Snippets are sandboxed. Use jsfiddle in those cases.
    – rene
    Commented Jan 25, 2018 at 8:09
  • 3
    Considering these related posts about Stack Snippets & cross-origin, I don't think they will do anything...
    – Andrew T.
    Commented Jan 25, 2018 at 9:18
  • 2
    If we're expected to use snippets to maintain the content of the site in case 3rd parties go offline / get removed etc then surely things like this need to be supported?
    – webnoob
    Commented Jan 25, 2018 at 23:49
  • It would be nice... how does jsfiddle manage it without sacrificing security? I'll admit I'm a bit unclear about what exactly ckeditor is doing on line 1190 that's not allowed. Is it possible to insulate the snippets from the rest of society so that they don't become violent and abusive? Commented Jan 26, 2018 at 1:16
  • Is it this? var h = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();" Commented Jan 26, 2018 at 1:18
  • @billynoah Maybe they simply do sacrifice security...
    – Bakuriu
    Commented Jan 27, 2018 at 10:35
  • @webnoob; there's nothing saying you can't have a working copy on a third-party site and leave a copy of the code on SO in case that site goes down. There's never been a prohibition on using jsfiddle to demonstrate code; the code just has to also be included here. Commented Jan 27, 2018 at 22:56

0

You must log in to answer this question.

Browse other questions tagged .