tinymce/tinymce — pull request #395 by HoLyVieR (2014-06-30 15:59:01+00:00)
Title: Sandbox mode

This is still a work in progress feature, but it's being pull request since I wanted to get input from the community before going any further.

**What is the "sandbox" mode ?**

The purpose of this pull request is to have an option to sandbox the execution of anything being executed in the iframe of the RTE on a domain other than the one where the editor is being embedded. This is mostly to mitigate permanent XSS attack while allowing script tags, "on" attributes, etc.

This features should be 100% backward compatible (it will simply not use it, if the browser doesn't support postMessage) and shouldn't affect anything if there is no "sandbox" parameter.

**How to test ?**

1. Host on a CDN the following structure
- sandbox.html
- tinymce/js/tinymce/tinymce.min.js

2. Use the following configuration for the TinyMCE

```
tinymce.init({
selector: "textarea",
sandbox: "http://[CDN-DOMAIN]/sandbox.html"
});
```

Note : I have hosted a version of the sandbox on `agile-beyond-2236.herokuapp.com`, so you can use `http://agile-beyond-2236.herokuapp.com/sandbox.html` as a sandbox parameter to save you the trouble of hosting it.

**What I'd like to get feedback for**

- Is this the best way to integrate such feature ?
- What kind of test should I include ?
- What is potentially broken in this mode ?