Greasy Fork

Greasy Fork is available in English.

Skribbl - Quality of Life

Quality of life improvements for Skribbl.io

目前为 2022-05-17 提交的版本。查看 最新版本

// ==UserScript==
// @name         Skribbl - Quality of Life
// @version      0.2
// @description  Quality of life improvements for Skribbl.io
// @author       4TSOS
// @match        http*://skribbl.io/*
// @run-at       document-idle
// @icon         https://www.google.com/s2/favicons?sz=64&domain=skribbl.io
// @namespace null
// ==/UserScript==

(function() {
    'use strict';
    document.title = "Skribbl.io";
    const globalObserver = new MutationObserver(function(mutation) {
        if (document.querySelector("#inputChat")) {
            document.body.addEventListener('keydown', function(event) {
                if (document.querySelector("#inputName")) {
                    document.querySelector("#inputChat").focus();
                }
                if (document.querySelector("#inputName")) {
                    document.querySelector("#inputName").focus();
                };
            });
        };
    });
    globalObserver.observe(document.body, {childList: true, attributes: true, subtree: true});
})();