@Override public WebDriver parentFrame() { currentWindow = currentWindow.getParentWindow(); return HtmlUnitDriver.this; }
/** * Returns the value of the parent property. * @return the value of window.parent */ public SimpleScriptable jsxGet_parent() { final WebWindow parentWebWindow = webWindow_.getParentWindow(); return (SimpleScriptable) parentWebWindow.getScriptObject(); }
/** * Returns the value of the parent property. * @return the value of window.parent */ public SimpleScriptable jsxGet_parent() { final WebWindow parentWebWindow = webWindow_.getParentWindow(); return (SimpleScriptable) parentWebWindow.getScriptObject(); }
/** * Returns the value of the parent property. * @return the value of window.parent */ public SimpleScriptable jsxGet_parent() { final WebWindow parentWebWindow = webWindow_.getParentWindow(); return (SimpleScriptable) parentWebWindow.getScriptObject(); }
/** * Returns a list containing all the frames (from frame and iframe tags) in this page. * @return a list of {@link FrameWindow} */ public List<FrameWindow> getFrames() { final List<FrameWindow> list = new ArrayList<FrameWindow>(); final WebWindow enclosingWindow = getEnclosingWindow(); for (final WebWindow window : getWebClient().getWebWindows()) { // quite strange but for a TopLevelWindow parent == self if (enclosingWindow == window.getParentWindow() && enclosingWindow != window) { list.add((FrameWindow) window); } } return list; }
/** * Returns a list containing all the frames (from frame and iframe tags) in this page. * @return a list of {@link FrameWindow} */ public List<FrameWindow> getFrames() { final List<FrameWindow> list = new ArrayList<FrameWindow>(); final WebWindow enclosingWindow = getEnclosingWindow(); for (final WebWindow window : getWebClient().getWebWindows()) { // quite strange but for a TopLevelWindow parent == self if (enclosingWindow == window.getParentWindow() && enclosingWindow != window) { list.add((FrameWindow) window); } } return list; }
/** * Returns a list containing all the frames (from frame and iframe tags) in this page. * @return a list of {@link FrameWindow} */ public List<FrameWindow> getFrames() { final List<FrameWindow> list = new ArrayList<FrameWindow>(); final WebWindow enclosingWindow = getEnclosingWindow(); for (final WebWindow window : getWebClient().getWebWindows()) { // quite strange but for a TopLevelWindow parent == self if (enclosingWindow == window.getParentWindow() && enclosingWindow != window) { list.add((FrameWindow) window); } } return list; }
/** * Returns the value of the {@code parent} property. * @return the value of the {@code parent} property */ @JsxGetter public ScriptableObject getParent() { final WebWindow parent = getWebWindow().getParentWindow(); return parent.getScriptableObject(); }
/** * Returns the value of the {@code parent} property. * @return the value of the {@code parent} property */ @JsxGetter public ScriptableObject getParent() { final WebWindow parent = getWebWindow().getParentWindow(); return parent.getScriptableObject(); }
/** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test * @return {@code false} if no parent has already this URL */ private boolean isAlreadyLoadedByAncestor(final URL url) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { if (UrlUtils.sameFile(url, window.getEnclosedPage().getUrl())) { return true; } if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; } else { window = window.getParentWindow(); } } return false; }
@Override public void webWindowClosed(WebWindowEvent event) { // Check if the event window refers to us or one of our parent windows // setup the currentWindow appropriately if necessary WebWindow curr = currentWindow; do { // Instance equality is okay in this case if (curr == event.getWebWindow()) { currentWindow = currentWindow.getTopWindow(); return; } curr = curr.getParentWindow(); } while (curr != currentWindow.getTopWindow()); } });
return opener.getParentWindow(); if (window == window.getParentWindow()) { window = window.getParentWindow();
/** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test * @return {@code false} if no parent has already this URL */ private boolean isAlreadyLoadedByAncestor(final URL url) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { if (UrlUtils.sameFile(url, window.getEnclosedPage().getUrl())) { return true; } if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; } else { window = window.getParentWindow(); } } return false; }
private boolean isAlreadyLoadedByAncestor( final URL url, HtmlPage page ) { WebWindow window = page.getEnclosingWindow(); while (window != null) { if (url.sameFile(window.getEnclosedPage().getWebResponse().getWebRequest().getUrl())) { return true; } if (window == window.getParentWindow()) { window = null; } else { window = window.getParentWindow(); } } return false; }
/** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test * @return <code>false</code> if no parent has already this URL */ private boolean isAlreadyLoadedByAncestor(final URL url) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { if (url.sameFile(window.getEnclosedPage().getWebResponse().getRequestSettings().getUrl())) { return true; } if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; } else { window = window.getParentWindow(); } } return false; }
/** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test * @return <code>false</code> if no parent has already this URL */ private boolean isAlreadyLoadedByAncestor(final URL url) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { if (url.sameFile(window.getEnclosedPage().getWebResponse().getRequestSettings().getUrl())) { return true; } if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; } else { window = window.getParentWindow(); } } return false; }
/** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test * @return <code>false</code> if no parent has already this URL */ private boolean isAlreadyLoadedByAncestor(final URL url) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { if (url.sameFile(window.getEnclosedPage().getWebResponse().getRequestSettings().getUrl())) { return true; } if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; } else { window = window.getParentWindow(); } } return false; }
/** * Returns this document's <tt>body</tt> element. * @return this document's <tt>body</tt> element */ public Object jsxGet_body() { final HtmlPage page = getHtmlPage(); // for IE, the body of a not yet loaded page is null whereas it already exists for FF if (getBrowserVersion().isIE() && (page.getEnclosingWindow() instanceof FrameWindow)) { final HtmlPage enclosingPage = (HtmlPage) page.getEnclosingWindow().getParentWindow().getEnclosedPage(); if (WebClient.URL_ABOUT_BLANK.equals(page.getWebResponse().getRequestSettings().getUrl()) && enclosingPage.getReadyState() != DomNode.READY_STATE_COMPLETE) { return null; } } final HtmlElement body = getHtmlPage().getBody(); if (body != null) { return body.getScriptObject(); } return null; }
/** * Returns this document's <tt>body</tt> element. * @return this document's <tt>body</tt> element */ public Object jsxGet_body() { final HtmlPage page = getHtmlPage(); // for IE, the body of a not yet loaded page is null whereas it already exists for FF if (getBrowserVersion().isIE() && (page.getEnclosingWindow() instanceof FrameWindow)) { final HtmlPage enclosingPage = (HtmlPage) page.getEnclosingWindow().getParentWindow().getEnclosedPage(); if (WebClient.URL_ABOUT_BLANK.equals(page.getWebResponse().getRequestSettings().getUrl()) && enclosingPage.getReadyState() != DomNode.READY_STATE_COMPLETE) { return null; } } final HtmlElement body = getHtmlPage().getBody(); if (body != null) { return body.getScriptObject(); } return null; }
/** * Returns this document's <tt>body</tt> element. * @return this document's <tt>body</tt> element */ public Object jsxGet_body() { final HtmlPage page = getHtmlPage(); // for IE, the body of a not yet loaded page is null whereas it already exists for FF if (getBrowserVersion().isIE() && (page.getEnclosingWindow() instanceof FrameWindow)) { final HtmlPage enclosingPage = (HtmlPage) page.getEnclosingWindow().getParentWindow().getEnclosedPage(); if (WebClient.URL_ABOUT_BLANK.equals(page.getWebResponse().getRequestSettings().getUrl()) && enclosingPage.getReadyState() != DomNode.READY_STATE_COMPLETE) { return null; } } final HtmlElement body = getHtmlPage().getBody(); if (body != null) { return body.getScriptObject(); } return null; }