Updating my old extension with react based version

130 views
Skip to first unread message

Abu Abdullah

unread,
May 17, 2024, 9:57:07 AMMay 17
to Chromium Extensions
Hello all,
I had launched my chrome extension about 2 years ago using vanilla JS, CSS etc. and I want to rebuild my extension using react based version.

My question is, 
- How will I make sure that the data stored in the 'chrome.storage.local' are retained and not get deleted?
- How can i test the same in my local machine?

Here 's what I did:
- I installed the (vanilla JS based) chrome extension in my laptop. 
- In my new react based pkg, I added the public key of the current extension from developer dashboard under 'key' in the manifest.json. 
- Now when I tried to load the react based pkg in 'My extensions' page the old one is replaced with this new pkg and I was able to see the required data stored in the 'storage'.
- But on every update in my local pkg, the new pkg in 'My extension' page seems to be replaced with the old (vanilla JS based) one. And I have to load the react based pkg everytime.

Anyways, plz do lmk what should I do here and what are the best practices that i need to keep in mind while doing this?

Thanks in advance.

Patrick Kettner

unread,
May 20, 2024, 9:40:00 AMMay 20
to Abu Abdullah, Chromium Extensions
Hello Abu

> How will I make sure that the data stored in the 'chrome.storage.local' are retained and not get deleted?

The data isn't deleted unless you or the user delete it. Changing the code of the extension won't impact the data you have saved.

As for your testing - do you have the one installed from the store at the same time as your local device?

patrick

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/030ae5c7-9152-40e2-8062-6aa664cd1a77n%40chromium.org.

Patrick Kettner

unread,
May 25, 2024, 8:31:52 AMMay 25
to Abu Abdullah, Chromium Extensions
If it keeps getting replaced, that would likely explain why. Either uninstall the official one, or create a new profile in Chrome to test your dev version in to prevent them from stepping on one another.

On Sat, May 25, 2024 at 8:27 AM Abu Abdullah <abu....@gmail.com> wrote:
Hey Patrick,
Apologies for the late response. Yeah, I have both the extensions (one from the store and one that am building afresh) installed in my machine.

Regards,
Abu

Patrick Kettner

unread,
May 25, 2024, 9:08:43 AMMay 25
to Abu Abdullah, Chromium Extensions
Hi Abu
I would create a development version of your extension that is the same as your currently live verison (i.e. mv2), then apply your mv3 changes and reload the extension in chrome. 

On Sat, May 25, 2024 at 9:06 AM Abu Abdullah <abu....@gmail.com> wrote:
Understood Patrick.

Specifically, I have stored 'user_id' in 'chrome.storage.local' in the current extension which is in the store. Now, when I publish the new react code based pkg I assume the same will be accessed by the new pkg as well (correct me if I am wrong here). But how will I access the same data during the development of the react based pkg in my local?

I tried to add the same public key of the current extension in my new react pkg but I still couldn't access it. Hence I installed my old one first, completed the sign in flow and after adding my new react pkg I can access the 'user_id' in my new pkg too. But the only issue was the pkg was getting replaced.

If there is any better approach kindly give me advice.

Abu Abdullah

unread,
May 27, 2024, 7:07:21 PMMay 27
to Patrick Kettner, Chromium Extensions
Understood Patrick.

Specifically, I have stored 'user_id' in 'chrome.storage.local' in the current extension which is in the store. Now, when I publish the new react code based pkg I assume the same will be accessed by the new pkg as well (correct me if I am wrong here). But how will I access the same data during the development of the react based pkg in my local?

I tried to add the same public key of the current extension in my new react pkg but I still couldn't access it. Hence I installed my old one first, completed the sign in flow and after adding my new react pkg I can access the 'user_id' in my new pkg too. But the only issue was the pkg was getting replaced.

If there is any better approach kindly give me advice.


Abu Abdullah

unread,
May 27, 2024, 7:07:23 PMMay 27
to Patrick Kettner, Chromium Extensions
Hey Patrick,
Apologies for the late response. Yeah, I have both the extensions (one from the store and one that am building afresh) installed in my machine.

Regards,
Abu

On Mon, May 20, 2024 at 7:09 PM Patrick Kettner <patrick...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages