Untitled

 avatar
unknown
javascript
a year ago
1.4 kB
5
No Index
// ==UserScript==
// @name         KG_No_Game_Input
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Set opacity to 0, position absolutely, and prevent user selection for element with ID "inputtext"
// @match        https://klavogonki.ru/g/?gmid=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to modify the element
    function modifyElement() {
        var element = document.getElementById('inputtext');
        if (element) {
            // Set the opacity to 0
            element.style.opacity = '0';
            // Set the position to absolute
            element.style.position = 'absolute';
            // Prevent user selection
            element.style.userSelect = 'none';
            element.style.webkitUserSelect = 'none'; // For WebKit browsers
            element.style.mozUserSelect = 'none'; // For Firefox
            element.style.msUserSelect = 'none'; // For Internet Explorer/Edge
        }
    }

    // Run the function once the DOM is fully loaded
    document.addEventListener('DOMContentLoaded', modifyElement);

    // Also run the function in case the element is added later dynamically
    var observer = new MutationObserver(modifyElement);
    observer.observe(document.body, { childList: true, subtree: true });
})();
Editor is loading...
Leave a Comment