Google Meet Auto Recording Extension 开发问题

问题描述

我正在开发一个 Google 扩展程序,旨在自动记录 Google Meet。我尝试在 javascript 中使用 autoclick 功能。但是当我以 Workspace 用户身份召开会议时它没有执行。我的代码有什么问题吗?谢谢回复

    // autoclick function
function iclick(node) {
    let event = document.createEvent("MouseEvents");
    event.initEvent("click",true,false);
    node.dispatchEvent(event);
}

function autoRecord(node,interceptor) {
    if (!node) return;
    if (interceptor(node)) return;
        try {
            node = node.contentDocument;
            if (!node) return;
        } catch (e) {
            return;
        }
    for (let childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
        autoRecord(childNode,interceptor);
    }
}

// get the Meet web content,clicking it with iclick()
function autorecorrd() {
    autoRecord(document.body,(node) => {
        if (node.nodeName == "#text" &&
            (node.textContent.indexOf("theme") != -1 )) {
                    iclick(node);
        }
        //  錄製 = record
        if (node.nodeName == "#text" &&
            (node.textContent.indexOf("錄製") != -1)) {
                    iclick(node);
        }
        // 開始錄製 = start recording
        if (node.nodeName == "#text" &&
            (node.textContent.indexOf("開始錄製") != -1)) {
                    iclick(node);
        }
        // 開始 = start
        if (node.nodeName == "#text" &&
            (node.textContent.indexOf("開始") != -1)) {
                    iclick(node);
        }
        return false;
    });
}

// execute the function
autoRecord()

这些是我在 Meet 中得到的 HTML 元素:

Google Meet Record button 1

Google Meet button 2

confirm window before recording

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...