If I set localStorage
item then StorageEvent
is firing for all same-domain windows except current.
If I raise StorageEvent
programmatically then StorageEvent
is firing only for target window.
Code example:
var evt = document.createEvent('StorageEvent');
evt.initStorageEvent('storage',false,false,'key','oldValue','newValue',
'http://example.com',window.localStorage);
window.dispatchEvent(evt);
Can I modify the code example to simulate behaviour from window.setItem