Oddbean new post about | logout
 #cloudflare turnstile #capcha #userscript getting started:

this user script finds "verity you are human" element from dom,

if(window.self.location.href.indexOf("cloudflare") != -1){
  Element.prototype._attachShadow = Element.prototype.attachShadow;
  Element.prototype.attachShadow = function () {
    return this._attachShadow( { mode: "open" } );
  };

  console.log("window", window.top, window.self, document, window.self.location.href)
  console.log("document.scrollingElement", document.scrollingElement)

  setTimeout(function(){
    console.log("timeout")
    const body = document.scrollingElement.querySelector("body")
    console.log("body", body)
    console.log("body.shadowRoot", body.shadowRoot)
    
    setTimeout(function(){
      const label = body.shadowRoot.querySelector("label")
      console.log("cloudflare element", label.innerText)
      // you can click it but it results in error
      //label.click()
    }, 1000)
  }, 1000)
}