I do a basic browser.local.sync sync test:

let monster = {
  name: "Kraken",
  tentacles: true,
  eyeCount: 10,
};

let kitten = {
  name: "Moggy",
  tentacles: false,
  eyeCount: 2,
};

browser.storage.sync.set({ kitten, monster });

and on the second profile:

await browser.storage.local.get("kitten");

but nothing happens, get("kitten") returns nothing.

QUESTIONS:

  1. Does the synchronization work on a zip file loaded from Add-ons -> Tools for all add-ons -> Install add-on from file…?
    I have in manifest.json applications.gecko.id, as needed.
  2. If not, what do I need to do to TEST the synchronization work?

API https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync

  • igorlogius@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 year ago

    In Firefox, extension data is synced every 10 minutes or whenever the user selects Sync Now in Settings > Sync or Firefox account.

    Did you connect a sync account and wait long enough?