微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Google Meet Auto Recording Extension 开发问题

如何解决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 举报,一经查实,本站将立刻删除。