5 comments

[ 1.7 ms ] story [ 21.4 ms ] thread
For the lazy, here's the magic:

  <script>
    document.currentScript.remove();
    setTimeout(function() {
      // no rights reserved (BSD0) by Jeremy Banks <_@jeremy.ca>

      const html = document.documentElement.outerHTML;

      document.open('text/plain');
      document.write('view source disabled');
      document.close();

      document.documentElement.innerHTML = html;
    });
  </script>