-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
follow-up: chromeNeeds a response from a Chrome representativeNeeds a response from a Chrome representativeproposalProposal for a change or new featureProposal for a change or new featuresupportive: 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[]
}Metadata
Metadata
Assignees
Labels
follow-up: chromeNeeds a response from a Chrome representativeNeeds a response from a Chrome representativeproposalProposal for a change or new featureProposal for a change or new featuresupportive: 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.