-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add session storage access levels, live update across instances + TSDocs IntelliSense for guidance #308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. We will check and reply to you as soon as possible.
…rough type guards and stay DRY
Found some time 🐌🐌 Cross-Page Live UpdateLive Update across all extension instances are now available, leading to the theme value to update in real-time. Removed ts-ignore commentsFactored out your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG.... it's insane!
I really appreciate the kind help and contributions from the other side of the world.
@all-contributors please add @D1no for code |
I've put up a pull request to add @D1no! 🎉 |
Thank you 🥰 feel free to ship it or let me k ow what I should change ❤️ love intercontinental collaboration |
live update across instances + TSDocs IntelliSense for guidance Cherry-picked from c580f70 Jonghakseo/chrome-extension-boilerplate-react-vite@c580f70 See Jonghakseo/chrome-extension-boilerplate-react-vite#308 Co-authored-by: JongHak Seo <[email protected]>
live update across instances + TSDocs IntelliSense for guidance Cherry-picked from c580f70 Jonghakseo/chrome-extension-boilerplate-react-vite@c580f70 See Jonghakseo/chrome-extension-boilerplate-react-vite#308 Co-authored-by: JongHak Seo <[email protected]>
Hi thank you for maintaining this boilerplate :)
Session Storage Area and Access Levels
I've noticed that
StorageType.Session
wasn't able to be fully utilized, since they need an extra access-level step in chrome to allow content scripts to also access that storage area. A functionality that is pretty important for background workers processing page content.So I have added that functionality after noticing.
In-Code Guidance via TSDocs
Also, since the whole browser extension landscape is rather confusing for most people, I have added brief TSDocs to the
createStorage
interface and proximal types to provide in editor guidance:Cross-Page Live Update
Originally I wanted to extend your creatStorage solution with an aditional
liveUpdate
flag to be able to keep its many instances (content, popup, side panel, etc) synchronized through properly invalidating the cache withonChanged
listeners... but I ran out of time for now.In its current form, the storage and hooks only get pulled once a page starts... kinda omitting the big advantage of using the storage for keeping state in sync. Like when you change the color of your
theme
, you probably want that to be applied everywhere directly and not have to open and close pages.Maybe I can do that at another time. All the best from Berlin!
Note:
Heads up: I am not sure how serious the firefox support in a chrome extension boilerplate is, but session storage areas are very differently handled by firefox. See here: chrome.storage.session in firefox