I am opening a popup chrome window.
let popup = window.open(redirectUrl, '_blank');
I want to take the variable set in the localstorage in that window, before it closes. I have written code as
popup.onbeforeunload = (e) => {
console.log(popup.localStorage.abc);
}
But this line is not getting executed. I debugged,Debugger is not even going inside the method. Please help me in what I am doing wrong or is there any other way?