murielguedes / Digitação Produtividade

// ==UserScript==
// @name        Digitação Produtividade
// @description Digitação Produtividade
// @author      murielguedes@pm.me
// @namespace   https://github.com/muriel-guedes/digitacao-produtividade
// @copyright   2023, murielguedes (https://openuserjs.org/users/murielguedes)
// @license     MIT
// @version     1.0
// @run-at      document-end
// @grant       none
// @match       https://desenv.facta.com.br/sistemaNovo/propostaSimulador.php
// @match       https://plataforma-vendas.bancomaster.com.br/saque/saque-cadastro
// ==/UserScript==

document.body.addEventListener('keydown', function (e) {
  if (e.altKey && e.key == "w")
    switch(window.location.href) {

      case "https://desenv.facta.com.br/sistemaNovo/propostaSimulador.php": {
        var delay = 0
        for (const [id, value] of [
            ["produto", "D"],
            ["tipoOperacao", 13],
            ["averbador", 20095],
            ["banco", 3]
          ]) {
          setTimeout(() => {
            let e = document.getElementById(id)
            e.value = value
            e.dispatchEvent(new Event('change'))
          }, delay)
          delay += 1000
        }
      }

      case "https://plataforma-vendas.bancomaster.com.br/saque/saque-cadastro": {
        for(let i of document.getElementsByClassName("mat-checkbox-input"))
          i.click()
      }

    }
  else if (e.altKey && e.key == "W")
    switch(window.location.href) {

      case "https://plataforma-vendas.bancomaster.com.br/saque/saque-cadastro": {
        document.getElementById("mat-input-4").value = "300"
        document.getElementById("mat-input-5").value = "123456"
        document.getElementById("mat-input-6").valueAsDate = new Date(prompt("Date").replace(/\s/g, '').split("/").reverse().join("-"))
      }

    }
})