pull the current URL from the active window

I’ve been using multiple windows more lately and finally figured out that I hard-coded Current Web Page to pull from the first window. In my defense, there was no obvious way to get the active window. (“visible”? Come on.)

Most of the changes are just to indent things inside the test for at least one active window.