<html> <head> </head> <body> <script> var storage = window.localStorage; function readStoredData(event) { var key = event.key; var newValue = event.newValue; if (key == "testData") { var newData = JSON.parse(newValue); console.log("New Data: " + newData.length); } if (key == "testString") { console.log("String: " + newValue); } } window.addEventListener("storage", readStoredData, false); var data = []; for (var i = 0; i < 200; i++) { data.push({ id: i, message: "Message №" + i }); } storage.setItem("testData", JSON.stringify(data)); storage.setItem("testString", "string"); </script> </body> </html>
When saving a small string, the event is generated, but when I try to save a large array, the event is not generated, and the array is saved.
Ps IE browser