final HtmlPage page = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); if (newLocation.startsWith(JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { final String script = newLocation.substring(11);
final HtmlPage page = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); if (newLocation.startsWith(JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { final String script = newLocation.substring(11);
/** * Reloads the current page, possibly forcing retrieval from the server even if * the browser cache contains the latest version of the document. * @param force if {@code true}, force reload from server; otherwise, may reload from cache * @throws IOException if there is a problem reloading the page * @see <a href="http://msdn.microsoft.com/en-us/library/ms536342.aspx">MSDN Documentation</a> */ @JsxFunction public void reload(final boolean force) throws IOException { final HtmlPage htmlPage = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final WebRequest request = htmlPage.getWebResponse().getWebRequest(); String referer = htmlPage.getUrl().toExternalForm(); request.setAdditionalHeader(HttpHeader.REFERER, referer); referer = UrlUtils.getUrlWithNewQuery(htmlPage.getUrl(), null).toExternalForm(); referer = StringUtils.stripEnd(referer, "/"); request.setAdditionalHeader(HttpHeader.ORIGIN, referer); final WebWindow webWindow = window_.getWebWindow(); webWindow.getWebClient().download(webWindow, "", request, true, false, "JS location.reload"); }
/** * Reloads the current page, possibly forcing retrieval from the server even if * the browser cache contains the latest version of the document. * @param force if {@code true}, force reload from server; otherwise, may reload from cache * @throws IOException if there is a problem reloading the page * @see <a href="http://msdn.microsoft.com/en-us/library/ms536342.aspx">MSDN Documentation</a> */ @JsxFunction public void reload(final boolean force) throws IOException { final HtmlPage htmlPage = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final WebRequest request = htmlPage.getWebResponse().getWebRequest(); String referer = htmlPage.getUrl().toExternalForm(); request.setAdditionalHeader(HttpHeader.REFERER, referer); referer = UrlUtils.getUrlWithNewQuery(htmlPage.getUrl(), null).toExternalForm(); referer = StringUtils.stripEnd(referer, "/"); request.setAdditionalHeader(HttpHeader.ORIGIN, referer); final WebWindow webWindow = window_.getWebWindow(); webWindow.getWebClient().download(webWindow, "", request, true, false, "JS location.reload"); }
final HtmlPage page = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final PostponedAction action = new PostponedAction() {
final HtmlPage page = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final PostponedAction action = new PostponedAction() {
final HtmlPage page = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final PostponedAction action = new PostponedAction() {