ctrl^C + ctrl^V = 💪

pressing "Numpad Subtract" to copy and paste the very last message in the chat!!

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

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

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         ctrl^C + ctrl^V = 💪
// @namespace    http://tampermonkey.net/
// @version      ver-6.9
// @description  pressing "Numpad Subtract" to copy and paste the very last message in the chat!!
// @author       vflc
// @match        https://meet.google.com/*
// ==/UserScript==

(function() {
  'use strict';

  document.body.onkeyup = function(e) {
    // 109 is the keycode for "Numpad Subtract"
    // here's the keycode list
    // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
    if(e.keyCode == 109){
      e.stopPropagation();
      e.preventDefault();

      let chat = document.getElementsByClassName("oIy2qc");
      let text = chat[chat.length - 1].innerHTML;

      let input = document.getElementsByClassName("KHxj8b tL9Q4c");
      input[0].value = text;

      let send = document.getElementsByClassName("uArJ5e Y5FYJe cjq2Db IOMpW Cs0vCd RDPZE");
      send[0].setAttribute("aria-disabled",false);
      send[0].click();
      send[0].setAttribute("aria-disabled",true);
      document.activeElement.blur();
    }
  };

})();