-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow using chrome.storage.local
#60
Conversation
So it seems my confusion is not unwarranted, passing in
Lmk if you have preferences between those 2! |
Ok, went with option 2 as it seemed simple enough |
Thank you for the PR! I'd rather not include the polyfill, also because this change won't work if users pass a raw You can pass a string instead |
huh, I'm curious why? I was really surprised this using |
Because it's as large as this package + it's not necessary ( If I really need promise API, I made a 300-byte wrapper, but that's still not required for this change.
|
Pushed an update to use the string type |
index.ts
Outdated
@@ -32,6 +32,8 @@ async function shouldRunMigrations(): Promise<boolean> { | |||
}); | |||
} | |||
|
|||
export type StorageType = 'sync' | 'local' | 'managed'; |
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.
managed
is read-only, it's not supported by webext-options-sync
export type StorageType = 'sync' | 'local' | 'managed'; | |
export type StorageType = 'sync' | 'local'; |
readme.md
Outdated
@@ -244,6 +244,13 @@ Default: `true` | |||
|
|||
Whether info and warnings (on sync, updating form, etc.) should be logged to the console or not. | |||
|
|||
###### storageType | |||
|
|||
Type: `'loacal' | 'sync' | 'managed'` |
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.
Type: `'loacal' | 'sync' | 'managed'` | |
Type: `'local' | 'sync' | 'managed'` |
checking in! 🙂 |
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.
The changes and the readme update look great!
Awesome, thanks so much both - looking forward to trying this! |
chrome.storage.local
I use it in https://github.com/transclude-me/extension
Motivation: I started using this via template, but apparently the values for settings are too large to store remotely 😿 . I still like the interface/form sync aspects of this and so, substituting the storage area to be local storage seems like a good solution.
Prior interest: #19
Question/confusion I have here - this lib is using the the chrome* api*s and yet works with FF, and supplying
browser.storage.local
works for passing the stoarge area here, but presumably this has different apis (callback vs promise). How does interop work here?