V3 Ctrl+Enter to post comments

Ctrl+Enter to post comments in V3

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         V3 Ctrl+Enter to post comments
// @namespace    aubymori
// @version      1.0.0
// @description  Ctrl+Enter to post comments in V3
// @author       aubymori
// @match        https://www.youtube.com/*
// @icon         https://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png
// @license      GPL-3.0
// @grant        none
// ==/UserScript==

window.addEventListener("keydown", function(e)
{
    if (e.key == "Enter" && e.ctrlKey && e.target.classList.contains("sb_text_input"))
    {
        let postButton = e.target.parentElement.querySelector(".jfk-button-action");
        if (postButton)
            postButton.click();
    }
});