Our volunteers haven't translated this article into Türkçe yet. Join us and help get the job done!
You can also read the article in English (US).

The onstorage property of the WindowEventHandlers mixin is an EventHandler for processing storage events.

The storage event fires when a storage area has been changed in the context of another document.


 window.onstorage = functionRef;


functionRef is a function name or a function expression. This function receives a StorageEvent as its sole argument.


This example logs the value for a storage key whenever it changes in another document.

window.onstorage = function(e) {
  console.log('The ' + e.key +
    ' key has been changed from ' + e.oldValue +
    ' to ' + e.newValue + '.');


Specification Status Comment
HTML Living Standard
The definition of 'onstorage' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onstorageChrome ? Edge Full support YesFirefox Full support 45IE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 45Opera Android ? Safari iOS ? Samsung Internet Android ?


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Last updated by: chrisdavidmills,