I have tried to follow the examples on the Safari Developer Site.
The documentation suggests adding an event listener like so:
window.addEventListene
I realize this is asking about Safari but, per the Mozilla Developer Network, the StorageEvent is only fired if the web storage object is changed from outside the page, e.g., in another tab.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
Scroll down to "Responding to storage changes with the StorageEvent".
(I would have added this as a comment to the accepted answer but I don't have the rep for that.)