localStorage in win8.1 IE11 does not synchronize

前端 未结 4 1204
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 05:41

We have two pages \"/read\" and \"/write\". Page \"/write\" each second updates localStorage with current time:

setInterval(function(){
    var time = (new          


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 06:29

    my solution - angular app:

     @HostListener('window:storage', ['$event'])
    
     testWindowStorage(event: StorageEvent) {
    
         if (event.key === 'xxx' && event.newValue !== event.oldValue 
             && event.newValue !== event.oldValue)) {
    
          //do your business
         }
     }
    

提交回复
热议问题