1

I am trying to open a new window and then detect when that window has closed. But so far nothing I have tried is working. I have the following:

methods: {
    submitForm: function(e) {
        var newWindow = window.open('https://www.google.com', '_blank')
        newWindow.onblur = this.windowClosing
    }

    windowClosing: function () {
        console.log('tab closing')
    }
}

The tab/window opens and what I would like to see is the "tab closing" in the parent window. I assume it might be writing it to the newWindow and then that is lost? I've also tried

window.addEventListener('xx')

Thank you

Luke Ramsden
  • 674
  • 4
  • 15
Adrian
  • 668
  • 9
  • 21
  • 1
    This might help you: https://stackoverflow.com/questions/5712195/js-listen-when-child-window-is-closed – Gerfried Sep 19 '18 at 10:52
  • @gerfried thanks for this. While it's close,it seems to fire the event when the tab opens but not when it closes – Adrian Sep 19 '18 at 12:17

0 Answers0