Google Meet Attendance

Copy google meet participants to clipboard on "u" key click

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

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.

You will need to install a user script manager extension to install this script.

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

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         Google Meet Attendance
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Copy google meet participants to clipboard on "u" key click
// @author       You
// @match        https://meet.google.com/*
// @grant        none
// ==/UserScript==

(function() {
    function copyToClipboard(text) {
        window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
    }
    'use strict';
    function main(){
    var divs = document.getElementsByTagName("div");
    var newNames = [""];
    for (var i=0; i<divs.length; i++){
        if (divs[i].getAttribute("aria-label")!=null && divs[i].getAttribute("aria-label").includes("Show more actions for ")){
            //console.log(i);
            var name = (divs[i].getAttribute("aria-label").replace("Show more actions for", ""));
            //console.log(name);
            if (newNames.indexOf(name)==-1){
                //console.log("success");
                newNames.push(name);
            }
        }
    }
    copyToClipboard(newNames);
    }
    document.onkeydown = function(e){
        e = e || window.event;
        var key = e.which || e.keyCode;
        if(key===85){ //change key code, currently set to "u"
            main();
        }
    }
})();