not saving properly


I’ve implemented an options-page in my addon that allows to configure how the frontend behaves. Before publishing the addon on and assigning a unique addon ID, this worked flawlessly.

Now that I’ve published the addon, saving new settings doesn’t work properly anymore, no matter if running the published addon or my development environment via web-ext. Sometimes the addon options page throws an “Type​Error: can’t access dead object” exception or after about 20 seconds some error message with “session id” is appearing.

Settings will be saved seemingly randomly after a minute or so, sometimes changes are completely lost.

I can only assume, that saving the settings via somehow doesn’t work anymore now that the addon is “live”. I use the following command:

'settings': this._settings

this._settings is a very small JSON that only consists of a few strings, integers and arrays.

In the frontend I gain access to the settings via initally loading them with‘settings’) into an object, then accessing the values within.

I use the latest Firefox Developer Edition. Happens also in non-developer editions.

Currently I call at any point when the settings change. Maybe this is the problem?
Is it better to use and for regular use in my addon, and only use and once in while?
E.g. only sync when the extension is updated, or every few hours, something like that.


Can anyone tell me something about using Am I using it wrongly, or is it somewhat common to run into server-lag when syncing to firefox?

(Martin Giger) #3

A couple of things:

  • You may want to cache the result from a sync.get call, since those can be fairly slow, since it fetches the data from the sync server. Afaik you have to cache yourself (but I may be wrong there).
  • I assume your sync.set promise is resolved and not rejected?
  • You are logged in with your Firefox Account and have add-on syncing enabled.