Clicking an Element on page load is even possible on webdriver; By default, webdriver wait for the entire page to load and then picks the element. The links and texts are visible but they are not clickable; However, it works well on Selenium IDE picking elements on page load.
I hope the below Firefox profile will help you to do the same for switching windows.
Webdriver make use of the FirefoxProfile to avoid such risks; It's applicable only for Firefox browser.
FirefoxProfile fp = new FirefoxProfile();
fp.setPreference("webdriver.load.strategy", "unstable");
driver = new FirefoxDriver(fp);