re: #3 Charles Johnson
It turns out to be pretty danged tricky to detect whether a new window has actually opened. Chrome returns a seemingly valid window handle even if the window has been blocked, so you can’t just check for a valid handle.
That’s the purpose of the setTimeout code at line 66 - if the browser is Chrome, it waits long enough for the window to be created, then checks to see if it has a non-zero innerHeight. Kinda kludgy, but it’s the best method I’ve seen.
I love that word: kludgy.