Fires when one or more items in a storage area change, returning details for the keys that changed. Compared to storage.onChanged, this event enables you to listen for changes in one of the storage areas: local, managed, session, and sync.

Note: In Firefox, the information returned includes all keys within the storage area. Also, the callback may be invoked when there is no change to the underlying data. Details of the changed items are found by examining each returned key's storage.StorageChange object. See Firefox bug 1833153.


// local can also be sync, managed, or session

Events have three functions:


Adds a listener to this event.


Stops listening to this event. The listener argument is the listener to remove.


Checks whether listener is registered for this event. Returns true if it is listening, false otherwise.

addListener syntax



The function called when this event occurs. The function is passed this argument:


object. Object describing the change. This contains one property for each key that changed. The property name is the name of the key that changed, and its value is a storage.StorageChange object describing the change to that item.


Log the old value and its new value of
changes in the local storage.
function logStorageChange(changes) {
  const changedItems = Object.keys(changes);

  for (const item of changedItems) {
    console.log(`${item} has changed:`);
    console.log("Old value: ", changes[item].oldValue);
    console.log("New value: ", changes[item].newValue);

Browser compatibility

BCD tables only load in the browser

Note: This API is based on Chromium's API. This documentation is derived from storage.json in the Chromium code.