[removed] not working in chrome

后端 未结 9 807
遥遥无期
遥遥无期 2020-11-27 07:25

This is the code which i used for window.onbeforeunload......




        
9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 08:16

    I'm running Chrome on MacOS High Sierra and have an Angular 6 project whithin I handle the window.beforeunload an window.onbeforeunload events. You can do that, it's worked for me :

    handleUnload(event) {
      // Chrome
      event.returnValue = true;
    }
    

    It show me an error when I try to put a string in event.returnValue, it want a boolean.

提交回复
热议问题