Comments (11)
I'd rather not offer this option because I think cross-device sync is always preferable from the user's point of view, but I'm willing to add this for extensions with options that are meant to be local (e.g. a port number)
PR welcome, documentation included.
from webext-options-sync.
from webext-options-sync.
What if we prefer to only store options locally rather than sync to the cloud across all user browsers/devices?
from webext-options-sync.
That’s the user’s choice, they can disable the sync
from webext-options-sync.
@fregante by 'disable the sync' you mean global browser sync right? Don't think it's configurable on per-addon basis. I'm working on extension where it might be desirable for user to use different settings across devices, then using local
makes sense, what do you think?
On the other hand I can implement it through multiple 'settings profiles', all of which are synced and then user chooses one of them, it's just a bit more work. This library supports named storages already though so the only tedious bit is having to keep track of ' current settings profile' setting separately.
from webext-options-sync.
Firefox doesn't allow a "temporary addon" (e.g. one loaded via about:debugging
) to use sync
;
Error: The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://mzl.la/3lPk1aE
You only get an ID once you submit your extension.
I'm going to make a PR to add an option to override sync
soon;
storageApi: chrome.storage.local
from webext-options-sync.
Firefox doesn't allow a "temporary addon" (e.g. one loaded via
about:debugging
) to usesync
;
Read the full error message. You only need to specify the add-on ID in the manifest. I use it all the time.
I'm going to make a PR to add an option to override
sync
soon;
Thank you! It's best to override it with a string though: storage: 'local'
from webext-options-sync.
Firefox doesn't allow a "temporary addon" (e.g. one loaded via about:debugging) to use sync;
Read the full error message. You only need to specify the add-on ID in the manifest. I use it all the time.
I don't have an add-on ID. The page linked in the error message says I get one when I upload / submit the extension for review;
Once you have finished developing the extension, you can package it and submit it to AMO for review and signing. If the packaged extension you upload does not contain an ID, AMO will generate one for you. It's only at this point that the add-on will be assigned a permanent ID, which will be embedded in the signed packaged extension.
Are you saying I can enter an arbitrary dummy one?
I'm going to make a PR to add an option to override sync soon;
Thank you! It's best to override it with a string though: storage: 'local'
I thought of doing that first but accepting an object doesn't cost this package anymore and it is more flexible. It could open the door for solutions to a lot of unforeseen problems / edge cases. Examples I can imagine:
- Maybe someone wants to pass some kind of polyfill / third-party wrapper.
- Maybe they want to pass their own custom object that does some pre-processing and then calls
chrome.storage.sync
.
But like I said, it's more about leaving the door open.
If you still disagree and really want a string, cool, I'll do it.
from webext-options-sync.
I don't have an add-on ID. The page linked in the error message says I get one when I upload / submit the extension for review;
I thought of doing that first but accepting an object doesn't cost this package anymore and it is more flexible. It could open the door for solutions to a lot of unforeseen problems / edge cases.
If you manage to make the types work, you can
from webext-options-sync.
I don't have an add-on ID. The page linked in the error message says I get one when I upload / submit the extension for review;
Ah OK. I won't bother then 👍
from webext-options-sync.
No interest in over 2 years, closing again.
If you're having trouble in Firefox: set a gecko.id
from webext-options-sync.
Related Issues (20)
- `syncForm` should trigger event HOT 1
- Migrations/defaults aren't set for developer extensions at launch
- `chrome.storage.sync.set` errors aren't caught
- Add mechanism to show that field was saved HOT 1
- Latest version (0.21.2) causes error "Uncaught (in promise)" HOT 2
- Add config for compressing options before chrome.sync.set HOT 6
- Remove defaults from stored options
- Form values set to `undefined` HOT 3
- Race condition in OptionsSync constructor HOT 1
- Migrations receive the old options + the new defaults
- Sync options to a third party HOT 4
- Add true ES module
- Move from Travis to GitHub Actions HOT 1
- Values from the store are cleared on page refresh (when trying to save `Set`) HOT 4
- Async migrations HOT 1
- Migrations fail on Safari
- Options type does not allow nested object or array keys HOT 3
- Allow post-processing of form data HOT 2
- "Change" event to subscribe to so extension pages can update each other HOT 2
- Use `onContextInvalidated` to add banner inviting the user to reload the page (or just reload it)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webext-options-sync.