Skip to content

[BUG] 潜在Bug - 长时间操作的浏览器,uuid 不变的话,setValue 执行时 chrome.tabs.sendMessage 会出现 Could not establish connection. Receiving end does not exist. #1022

@cyfung1031

Description

@cyfung1031

问题描述

测试 1

screen-capture.21.-reformatted-00.00.05.839-00.01.50.827-reformatted-00.00.06.638-00.01.50.821.1.mp4

我是长时间使用浏览器,也有把MacBook盖了一下再打开
未知重现方法。估计长时间使用,SW重启的因素有关
但把代码复杂到新脚本就没事了

uuid不变的情况下,打开新网址也会发生同一问题

有看到实际值有更新

测试 2

screen-capture.23.-reformatted-00.00.08.460-00.03.01.419.mp4

重现步骤

不详

脚本猫版本

v1.2.0-beta.5

操作系统以及浏览器信息

Brave 1.84.139 (Official Build) (arm64) Chromium: 142.0.7444.163

补充信息 (选填)

        async function i9(e, t, r) {
            let n = await e.sendMessage({
                action: t,
                data: r
            })
              , i = nA.getInstance().logger().with({
                action: t,
                data: r,
                response: n
            });
            if (i.trace("sendMessage"),
            null == n ? void 0 : n.code)
                throw console.error(n),
                n.message;
            try {
                return n.data
            } catch (e) {
                i.trace("Invalid response data", nO.E(e));
                return
            }
        }

里面的 n.data (TypeError: Cannot read properties of undefined (reading 'data'))

也就是 e.sendMessage 失败 return 了 undefined


解析1

screen-capture.24.-reformatted-00.00.18.041-00.06.26.316.1.1.1.mp4

消息机制会发送东西至不存在或已关掉的 tabs

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions