Firefox extension dev: observing preferencies, avoid multiple notifications

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-05-08T10:04:07Z Indexed on 2010/05/08 10:08 UTC
Read the original article Hit count: 201

Filed under:
|
|

Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function.

When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group.

What I want is observe to be called just once for group of preferences. Say

extensions.myextension.interval1
extensions.myextension.site
extensions.myextension.retry

so if one or all of those preferences are changed, I receive only 1 notification about it.

© Stack Overflow or respective owner

Related posts about firefox

Related posts about extension