private WebClient createWebClient(BrowserVersion version) { WebClient client = newWebClient(version); WebClientOptions options = client.getOptions(); options.setHomePage(WebClient.URL_ABOUT_BLANK.toString()); options.setThrowExceptionOnFailingStatusCode(false); options.setPrintContentOnFailingStatusCode(false); options.setJavaScriptEnabled(enableJavascript); options.setRedirectEnabled(true); options.setUseInsecureSSL(true); // Ensure that we've set the proxy if necessary if (proxyConfig != null) { options.setProxyConfig(proxyConfig); } client.setRefreshHandler(new WaitingRefreshHandler()); return modifyWebClient(client); }
private WebClient createWebClient(BrowserVersion version) { WebClient client = newWebClient(version); client.setThrowExceptionOnFailingStatusCode(false); client.setPrintContentOnFailingStatusCode(false); client.setJavaScriptEnabled(enableJavascript); client.setRedirectEnabled(true); try { client.setUseInsecureSSL(true); } catch (GeneralSecurityException e) { throw new WebDriverException(e); } // Ensure that we've set the proxy if necessary if (proxyConfig != null) client.setProxyConfig(proxyConfig); return modifyWebClient(client); }