/** * Returns <tt>true</tt> if the specified URL is the web client's current * homepage and the document calling the method is on the same domain as the * user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior * implementation. * @param url the URL to check * @return <tt>true</tt> if the specified URL is the current homepage */ public boolean isHomePage(final String url) { try { final URL newUrl = new URL(url); final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl(); final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage(); final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost()); final boolean isHomePage = (home != null && home.equals(url)); return (sameDomains && isHomePage); } catch (final MalformedURLException e) { return false; } }
/** * Returns <tt>true</tt> if the specified URL is the web client's current * homepage and the document calling the method is on the same domain as the * user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior * implementation. * @param url the URL to check * @return <tt>true</tt> if the specified URL is the current homepage */ public boolean isHomePage(final String url) { try { final URL newUrl = new URL(url); final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl(); final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage(); final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost()); final boolean isHomePage = (home != null && home.equals(url)); return (sameDomains && isHomePage); } catch (final MalformedURLException e) { return false; } }
/** * Returns <tt>true</tt> if the specified URL is the web client's current * homepage and the document calling the method is on the same domain as the * user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior * implementation. * @param url the URL to check * @return <tt>true</tt> if the specified URL is the current homepage */ public boolean isHomePage(final String url) { try { final URL newUrl = new URL(url); final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl(); final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage(); final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost()); final boolean isHomePage = (home != null && home.equals(url)); return (sameDomains && isHomePage); } catch (final MalformedURLException e) { return false; } }
/** * Causes the web client to navigate to the current home page. Part of the * <tt>#default#homePage</tt> default IE behavior implementation. * @throws IOException if loading home page fails */ public void navigateHomePage() throws IOException { final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient(); webClient.getPage(webClient.getHomePage()); }
/** * Causes the web client to navigate to the current home page. Part of the * <tt>#default#homePage</tt> default IE behavior implementation. * @throws IOException if loading home page fails */ public void navigateHomePage() throws IOException { final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient(); webClient.getPage(webClient.getHomePage()); }
/** * Causes the web client to navigate to the current home page. Part of the * <tt>#default#homePage</tt> default IE behavior implementation. * @throws IOException if loading home page fails */ public void navigateHomePage() throws IOException { final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient(); webClient.getPage(webClient.getHomePage()); }