As far as I understand:
window.addEventListener('storage', function(event){
...
}, false);
is subscription on both localStorage and sessionStorage events. Can I subscribe on localStorage events only?
Thanks.
As far as I understand:
window.addEventListener('storage', function(event){
...
}, false);
is subscription on both localStorage and sessionStorage events. Can I subscribe on localStorage events only?
Thanks.
I don't think you can, as you say
storage
is fired on the window when any storage item changes. You just have to check thestorageArea
property of the event when you receive it, and ignore the ones from session storage. E.g.: