dmv

DMV california test with shortcut in https://pass-dmv-test.com/

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         dmv
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  DMV california test with shortcut in https://pass-dmv-test.com/
// @author       Enxing Xiong
// @match        https://pass-dmv-test.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pass-dmv-test.com
// @grant        none
// @require      https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js
// @license MIT
// ==/UserScript==

function takeScreenshot() {
    // Capture a screenshot of the entire webpage
    html2canvas(document.body).then(function(canvas) {
        // Convert the screenshot to a data URL
        var screenshotData = canvas.toDataURL('image/png');

        // Create a temporary link and trigger a download
        var a = document.createElement('a');

        // Modify the file name to replace slashes with underscores
        var url = window.location.href;
        var fileName = url.replace(/[/\\?*:|"<>]/g, '_') + '.png';

        a.href = screenshotData;
        a.download = fileName;
        a.style.display = 'none';
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
    });
}
(function() {
    'use strict';
    var buttons = document.getElementsByClassName("btn btn-outline-primary");
    let prev = buttons[0]
    let next = buttons[2]
    let options = document.getElementsByClassName("form-check-input me-1")

    document.addEventListener('keydown', function(event) {
      // Check if the key pressed is 'A' (you can use any other key)
      if (event.key === 'n' || event.key === 'N') {
        prev.click();
      } else if (event.key === 'm' || event.key === 'M') {
        next.click();
      } else {

          switch (event.key) {
              case 'A':
              case 'a':
              case '1':
              case 'j':
                  options[0].click()
                  break;
              case 'B':
              case 'b':
              case '2':
              case 'k':
                  options[1].click()
                  break;
              case 'C':
              case 'c':
              case '3':
              case 'l':
                  options[2].click()
                  break;
              case 'D':
              case 'd':
              case '4':
              case ';':
                  options[3].click()
                  break;
              case 's':
                  takeScreenshot()

          }
      }

    });

})();