When you try to close a window in JavaScript with self.close(), the browser asks the end user permission before it will close the window if it doesn't have a parent. This can be irritating, because what if you don't want it to ask permission? What if what you are doing is dynamically creating a new main window?
The way to fix this is very simple. All you have to do is change the value of the opener property of the window class, like this:
window.opener = "Something";
Now you can close it like you normally would, like this:
self.close();
This works because the permissions of the opener property are read/write, making it simple to close the primary window of a site.