Multi paste

Copy every word from the clipboard into multiple consecutive input fields

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Multi paste
// @version      0.3
// @description  Copy every word from the clipboard into multiple consecutive input fields
// @author       You
// @match        https://*/*

// @icon         
// @grant        none
// @namespace https://greasyfork.org/users/948386
// ==/UserScript==

(async function() {
    'use strict';
    window.addEventListener("keydown", (e) => multiPaste( e));
})();

const multiPaste = async (e) => {
    if (e.ctrlKey && e.key === "p") {
        e.preventDefault()

        const text = await navigator.clipboard.readText();
        let arr = text.split(' ');
        let inputs = document.querySelectorAll('input[type="text"]')

        for (let i = 0; i < arr.length; i++) {
            if (i == inputs.length) break;
            inputs[i].value = arr[i];
            //console.log(inputs[i])
        }
    }

}