tor-browser

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

collapse-selection-into-textarea-and-createLink.html (655B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <script>
      6 "use strict";
      7 
      8 function editingHostOnFocus() {
      9  document.execCommand("selectAll", false)
     10 }
     11 function imgOnError() {
     12  document.designMode = "on"
     13 }
     14 function unknownElementOnFocus() {
     15  document.designMode = "off"
     16  getSelection().setPosition(document.querySelector("textarea"));
     17  document.execCommand("createLink", false, "x")
     18 }
     19 </script>
     20 </head>
     21 <body>
     22 <tt onfocusin="editingHostOnFocus()" contenteditable="true">
     23 <iframe></iframe>
     24 <textarea></textarea>
     25 <content onfocusout="unknownElementOnFocus()">
     26 <input autofocus="">
     27 <img onerror="imgOnError()" src="x">
     28 </content>
     29 </tt>
     30 </body>
     31 </html>