title: Uncaught IndexSizeError: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index
body: <p>What is problem here?</p>
  
  <pre><code>if ( window.getSelection() ) 
    EditField = window.getSelection().getRangeAt(0);
  </code></pre>
  
  <p>throws error: </p>
  
  <blockquote>
    <p>Uncaught IndexSizeError: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.</p>
  </blockquote>