I had a problem with new opened window of staying opened. So I defined new variable like
But a new problem occured:
The new window is staying opened regardless of clicking the window.opener. I want to close this new window if I click on a window.opener.