Skip to content

How to handle extension upgrade properly in content script UI with React? #620

Answered by aklinker1
ming535 asked this question in Q&A
Discussion options

You must be logged in to vote

It's there, see https://wxt.dev/entrypoints/content-scripts.html#context

Maybe I should add a page to the guide about this instead of hiding it in the entrypoint docs.

The ContentScriptContext class is very simple, and I'd recommend you read through the source code to fully understand how it works.

https://github.com/wxt-dev/wxt/blob/54e5ed0bb47964ddcbc8a5483f8b6ffe42704beb/src/client/content-scripts/content-script-context.ts


As for testing upgrade behavior... You'll need to make 2 zips: one of an old release (or just an older commit) with a smaller version number, and the second with your new code and a newer version number.

Before building the ZIPs, you'll need to add a key property to…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ming535
Comment options

Answer selected by ming535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants