I'm surprised this `createRange()` call works without being given the proper `iframe`. Are you sure this actually works when using the editor?