Custom time

Add an option for custom time

当前为 2022-07-06 提交的版本,查看 最新版本

// ==UserScript==
// @name         Custom time
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add an option for custom time
// @author       Anakojm
// @match        http*://arithmetic.zetamac.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zetamac.com
// @grant        none
// @license      GPL
// ==/UserScript==

(function() {
    'use strict';
    // Remove dropdown
    document.querySelector("div#welcome form.game-options p select").remove()
    // Create a new input element
    let input=document.createElement("Input")
    input.placeholder="Time (s)";
    // The website is looking for the content of the duration element
    input.name="duration";
    // Append the new input to the wepbage
    document.querySelector("div#welcome form.game-options p").append(input)
})();