tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

inserttext-with-empty-string-to-replace-selection.html (868B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <script>
      6 "use strict";
      7 
      8 addEventListener("load", async () => {
      9  const slot = document.createElement("slot");
     10  const mspace = document.getElementById("id_0");
     11  const metadata = document.getElementById("id_1");
     12  document.documentElement.appendChild(slot);
     13  mspace.outerHTML = "<mark id='id_2' contenteditable='true'><meta id='id_3'></mark>";
     14  try {
     15    await timeout(metadata.requestFullScreen());
     16  } catch (e) {}
     17  getSelection().selectAllChildren(document.querySelector("#id_2"));
     18  slot.contentEditable = "true";
     19  getSelection().collapseToEnd();
     20  getSelection().extend(document.querySelector("#id_3"), 0);
     21  document.designMode = "on";
     22  document.execCommand("insertText", false, "");
     23 });
     24 </script>
     25 </head><body><math>
     26  <mspace id="id_0"></mspace>
     27  <metadata id="id_1"></metadata>
     28 </math>
     29 </body></html>