I've just been going around looking for bits and pieces of HTML and javascript to put together a little thing that opens pandora in a popup window instead of a tab. I've got it to about where I want it but have a problem with setTimeout. My goal is to have it open the HTML file which then opens the popup window and closes the tab or whole main browser window leaving only the popup. I've found that using only self.close seems to not give it time to open the popup before it closes the whole browser, while adding setTimeout closes it on delay but causes the popup to be blocked. I really don't know anything about javascript and have just been playing around, so any help on a work around or other way of delaying self.close would be appreciated.
What I've got so far:
<html>
<title>Pandora</title>
<body onload="pandoraFunction(); setTimeout('closeFunction()', 3000)">
<script>
function pandoraFunction() {
window.open('http://www.pandora.com','window','menubar=yes,screenX=0,screenY=0,top=0,left=0,location=no,status=no,toolbar=no,scrollbars=yes,resizable=no,width=' + (screen.width - 10) + ',height=' + screen.availHeight);
}
function closeFunction() {
self.close()
}
</script>
</body>
</html>