Open Firefox in osx, one window is opened, close the window and you'll find that you have have no windows, but the application is still running, in this case `getMostRecentWindow` would return null regardless of the changes in this branch.