-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
proposalProposal for a change or new featureProposal for a change or new featuresupportive: chromeSupportive from ChromeSupportive from Chromesupportive: firefoxSupportive from FirefoxSupportive from Firefoxsupportive: safariSupportive from SafariSupportive from Safaritopic: storageIssues related to persisting data. Topics include browser.storage, web storage, and new APIs.Issues related to persisting data. Topics include browser.storage, web storage, and new APIs.
Description
Problem
When monitoring storage changes via a service worker, all changes activate the worker, even if only a specific value matters.
Proposal
Allow StorageArea.onChanged.addListener to accept an optional StorageChangeFilter as an argument.
browser.storage.local.onChanged.addListener(callback, filter?: StorageChangeFilter)
// Usage example
browser.storage.local.onChanged.addListener(handleChanges, {startsWith: ['flags:', 'global:']})
interface StorageChangeFilter {
// positive parameters
startsWith?: string[],
contains?: string[],
equals?: string[],
// negative parameters
doesNotStartWith?: string[],
doesNotContain?: string[],
doesNotEqual?: string[]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalProposal for a change or new featureProposal for a change or new featuresupportive: chromeSupportive from ChromeSupportive from Chromesupportive: firefoxSupportive from FirefoxSupportive from Firefoxsupportive: safariSupportive from SafariSupportive from Safaritopic: storageIssues related to persisting data. Topics include browser.storage, web storage, and new APIs.Issues related to persisting data. Topics include browser.storage, web storage, and new APIs.