Thank you, Pavel. Your first alternative implied that maybe an offscreen document in a manifest v3 update would automagically access the same .localStorage that was written by the background page of a previous manifest v2 version. If this is true, then
no migration is necessary – it
just works.
I thought this was highly unlikely, but I tried it and, to my amazement, it seems to work! Here is what I did:
• Load as Unpacked my old manifest v2 extension from a directory.
• Perform an operation to write some data to .localStorage.
• Replace all files in that directory with files from my new manifest v3 extension which accesses .localData via an offscreen document.
• In Chrome, Reload the extension.
• Perform an operation to read data from .localStorage –
Voila, the previously written data appears.
Since I don't see this documented anywhere that I can find, could you please confirm that this is expected and supported? Did the Chrome developers code this magic to make migration
just work, or is it an accident? It is not obvious to me that a background page and an offscreen window would share their .localStorage.