Is there a recommended way to store state and run content scripts on a tab-to-tab basis? #1366
Unanswered
gwesterman
asked this question in
Q&A
Replies: 2 comments
-
You could look into using something like this to sync state between different parts of your extension: https://www.npmjs.com/package/@webext-pegasus/store |
Beta Was this translation helpful? Give feedback.
0 replies
-
This looks great but sadly there is no support for the side panel yet. Currently I'm saving and syncing state using wxt/storage, which works quite well for now. I'll probably have to write some more utilities in order to achieve what I need until webext-pegasus supports the side panel. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The extension I am currently implementing has at this time two distinct features: Automatic scraping of information and enhancement of the UX using the scraped data.
Scraping information requires the extension to automatically navigate the site in one tab, while the user is using the site in another.
Some state is shared, but some should not be. There are also some content scripts that should only be injected when the user activates the scraping features in one of the tabs.
I've played around with conditional injection of content scripts, but it doesn't seem to be as straight forward and reliable as I'd want it to be.
At this point I'm contemplating syncing two instances of the extension that run in two different instances of the browser using separate profiles via Supabase's Realtime feature or even splitting these features into two separate extensions that are then synced in the same way.
This would be fairly simple but I'd rather stay within the browser if possible.
Beta Was this translation helpful? Give feedback.
All reactions