有没有办法在删除扩展时防止 chrome 清除 storage.local?

Is there a way to prevent chrome from clearing storage.local when removing the extension?

每次我删除扩展时,chrome 都会重置扩展的 storage.local,如果您使用开发模式扩展,这会很烦人。有没有办法阻止它这样做?

您可能会想到 2 个 DevTool 片段。 第一个将 storage.local 内容序列化为 JSON 字符串(在卸载扩展之前必须 运行) 第二个将 JSON 字符串恢复为 storage.local(在重新安装扩展后必须 运行)。

这些片段可重复用于您正在处理的每个扩展。

编辑:您必须将 JSON 字符串分开保存