Git Product home page Git Product logo

Comments (11)

fregante avatar fregante commented on June 9, 2024 2

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.

fregante avatar fregante commented on June 9, 2024

#8

from webext-options-sync.

AndersDJohnson avatar AndersDJohnson commented on June 9, 2024

What if we prefer to only store options locally rather than sync to the cloud across all user browsers/devices?

from webext-options-sync.

fregante avatar fregante commented on June 9, 2024

That’s the user’s choice, they can disable the sync

from webext-options-sync.

karlicoss avatar karlicoss commented on June 9, 2024

@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.

adam-lynch avatar adam-lynch commented on June 9, 2024

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.

fregante avatar fregante commented on June 9, 2024

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'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.

adam-lynch avatar adam-lynch commented on June 9, 2024

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.

fregante avatar fregante commented on June 9, 2024

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;

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings

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.

adam-lynch avatar adam-lynch commented on June 9, 2024

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;

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings

Ah OK. I won't bother then 👍

from webext-options-sync.

fregante avatar fregante commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.