有没有办法检测localStorage中的更改但是在相同的选项卡中它已被更改?
在脚本中,在storage上添加一个事件监听器
storage
window.addEventListener("storage", function () { // Storage updated. }, false);