我发现这条线索有部分答案:
Listen for changes with localStorage on the same window
虽然它可以在Chrome上运行,但我仍然不知道如何在Firefox或IE上运行。
Storage 接口发射 storage 它影响的全局对象上的事件。
Storage
storage
window.addEventListener("storage", function () { // your code }, false);
使用时也会触发此事件 setItem .
setItem