tor-browser

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

disabled-click-picker-manual.html (676B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Disabled input elements must not open pickers</title>
      4 <p>
      5  Click the Open buttons below. If clicking them does not open any pickers, then consider this as a passing test.<br>
      6  (This is manual because we don't have an event to check whether the picker is opened or not.)
      7 </p>
      8 <input disabled type="color" id="color"><button>Open</button><br>
      9 <input disabled type="file" id="file"><button>Open</button>
     10 <script>
     11  for (const button of document.getElementsByTagName("button")) {
     12    button.onclick = () => {
     13      const input = button.previousElementSibling;
     14      input.dispatchEvent(new MouseEvent("click"));
     15    }
     16  }
     17 </script>