Search code examples
javascriptgoogle-chromegoogle-chrome-extension

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


Everytime I remove the extension, chrome resets the extension's storage.local which is annoying if you use a dev mode extension. Is there a way to stop it from doing that?


Solution

  • You might think about 2 DevTool snippets. The first one which serialise storage.local content into a JSON string (that you have to run before extension uninstall) The second one which restore that JSON string to storage.local (that you have to run after extension reinstall).

    These snippets are reusable for every extension you are working on.

    EDIT: You have to save that JSON string apart