if (driver instanceof TakesScreenshot) {
T screenshot = ((TakesScreenshot) driver).getScreenshotAs(outType);
removeCanvasGeneratedByFirefoxDriverForScreenshots();
return screenshot;
} else if (driver instanceof RemoteWebDriver) {
WebDriver augmentedWebdriver = new Augmenter().augment(driver);
return takeScreenShotOnBrowser(augmentedWebdriver, outType);
} else if (driver instanceof WrapsDriver) {
return takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), outType);
} else {
throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");