detro/ghostdriver — pull request #73 by jimevans (2012-09-28 15:25:04+00:00)
Title: Fixing switchTo().window()

This pull request implements two fixes for switching windows. First, it changes session._getWindow() to use .windowName instead of .name when searching for windows by name. Second, it implements a check for the validity of the currently focused window for every command.

The validity check is perhaps not as elegant as I'd like it to be. Feel free to refactor as you see fit.