侦听器runtime.onInstalled因原因安装多次触发

时间:2018-11-27 12:04:04

标签: google-chrome google-chrome-extension

我们在后台脚本中同步添加了一个用于安装事件的事件侦听器:

const Browser = chrome

...

const onInstalledListener = (details) => {
    // Sends an analytics event "Extension Reloaded" with reason.
    // The event is linked to a user profile.
    // Each fresh installation has a unique profile.
}

...

Browser.runtime.onInstalled.addEventListener(onInstalledListener)

这对于MOST用户绝对有用。但是,在60 000个用户中,有60个正在发送事件,其中原因https://developer.chrome.com/extensions/runtime#type-OnInstalledReason)等于 install ,尽管事实上他们已经已安装。

此恶意安装事件每周发送几次。除了侦听器外,没有其他地方可以发送事件,并且我们不会更改原因属性。

无论操作系统如何(在Mac OS,Chrome OS和Windows用户中都已经看到这种行为,对于Linux发行版来说,数据不足)和跨Chrome版本(68、69和70),都会发生这种情况。完全相同的代码不会在Firefox Web Ext API中引起任何问题。

其他人也遇到过类似的问题吗?这可能是Chrome错误吗?我们可以提供更多信息来识别错误。

干杯,迈克尔

0 个答案:

没有答案