I have access to a website that allows custom web pages to be created and shared. They are created with CK3 editor. Given that I have created a page with the editor displaying a table I added java scruot to display info from a data list when a table element is clicked. Clicking does a search based upon innerHTML text in the table and retrieved info is displayed to user in a Popup window. The HTML for the window is created in a text string. The window is opened with a function and the HTML string is passed as an argument. Works great but once the window is opened it would normally be closed using the Close Window button, the X in upper right corner. But if someone does not do this and clicks on the page displaying the original table (the calling page) a new popup can be generated. Further the popups outlive the pages on the calling website. These can all be closed but the popups are still alive in the browser. How do I force the windows to close if focus is removed or someone navigates to other tabs that may be open on the website. (the function mentioned above does a window.open(" "," ",...) with the name field blank. I also observed that the script is actually paused at the point the popup opens and does not continue execution unitl the page containing the script becomes active but the finishing of the script is just a final exit from the function triggered by the click (in which is the popup activity.) Closing the popup returns focus to the calling page so the script completes normally.