我最近做了一个chrome扩展。 我看到很多人在统计数据中卸载它。 我想实现一个反馈功能,如果你卸载它,我至少可以知道原因是什么。 任何想法如何创建一个快速弹出窗口,他们可以提供反馈,它将直接转到我的电子邮件。 如果重要,请链接插件:Markit
答案 0 :(得分:4)
您现在唯一能做的就是拨打runtime.setUninstallURL
api,这意味着您可以在服务器端进行分析。
设置卸载时要访问的URL。这可用于清理服务器端数据,执行分析,并实施调查。
答案 1 :(得分:2)
我会在这里发布完整的代码,因为我花了一些时间来弄清楚究竟是怎么做到的。
将它放在您的后台脚本中或您知道它将被执行的任何地方。它只需要运行一次:
/* Check whether new version is installed */
chrome.runtime.onInstalled.addListener(function(details) {
/* other 'reason's include 'update' */
if (details.reason == "install") {
/* If first install, set uninstall URL */
var uninstallUrlLink = 'https://example.com';
/* If Chrome version supports it... */
if (chrome.runtime.setUninstallURL) {
chrome.runtime.setUninstallURL(uninstallUrlLink);
}
}
});
从this发帖子