Search code examples
ace-editor

Ace editor "SECURITY_ERR: DOM Exception 18" in Chrome when running locally (no server)


I'm trying to run Ace editor from file system for now and in Chrome I'm getting:

"SECURITY_ERR: DOM Exception 18"

FireFox doesn't mind it.

Found this on google groups:

due to same origin restrictions workers can't be loaded from cdn you need to put them on your site, and add ace.config.set("workerPath", "path/to/ace/src-min");

No joy.

I'm initializing the editor like so:

<script src="js/source-editor/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    ace.config.set( "workerPath", "js/source-editor/src-min-noconflict");
    editor.setTheme("ace/theme/monokai");
    editor.getSession().setMode("ace/mode/css");
</script>

Am I missing something hopelessly simple?


Solution

  • For what's it worth, issue disappears one deployed to server.