title: Get selected text from tech.io code section
body: <p>I'm writing an chrome extension, and I want to pick up selected text in code sections of tech.io, like this one: <a href="https://prnt.sc/hhfkwu" rel="nofollow noreferrer">https://prnt.sc/hhfkwu</a> on <a href="https://tech.io/playgrounds/347/javascript-promises-mastering-the-asynchronous/what-is-asynchronous-in-javascript" rel="nofollow noreferrer">https://tech.io/playgrounds/347/javascript-promises-mastering-the-asynchronous/what-is-asynchronous-in-javascript</a></p>
  
  <p>I have this function which works pretty much on any other website, but it doesn't work correctly here, it returns empty string or some weird unicode character:</p>
  
  <pre><code>function getSelectedText() {
  var text = "";
  var activeEl = document.activeElement;
  var activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
  if (
      (activeElTagName == "textarea") || (activeElTagName == "input" &amp;&amp;
          /^(?:text|search|password|tel|url)$/i.test(activeEl.type)) &amp;&amp;
      (typeof activeEl.selectionStart == "number")
  ) {
      text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
  } else if (window.getSelection) {
      text = window.getSelection().toString();
  }
      return text;
  }
  </code></pre>
  
  <p>How should I alter it in order to work on this particular code section on tech.io website?</p>