Javascript detect closing popup loaded with another domain

前端 未结 4 979
猫巷女王i
猫巷女王i 2020-12-04 20:29

I am opening a popup window and attaching an onbeforeunload event to it like this:

win = window.open(\"http://www.google.com\", \"\", \"width=300px,height=30         


        
4条回答
  •  独厮守ぢ
    2020-12-04 20:46

    You could listen to the 'focus' event of the opener window which fires when the user closes the popup.

提交回复
热议问题