MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / reload

Method reload

src/main/java/org/htmlunit/javascript/host/Location.java:242–254  ·  view source on GitHub ↗

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 true, force reload from server; otherwise, may reload from cache @throws IOException if there is a problem reloading the page @see <a hr

(final boolean force)

Source from the content-addressed store, hash-verified

240 * @see <a href="http://msdn.microsoft.com/en-us/library/ms536342.aspx">MSDN Documentation</a>
241 */
242 public void reload(final boolean force) throws IOException {
243 final WebWindow webWindow = window_.getWebWindow();
244 final HtmlPage htmlPage = (HtmlPage) webWindow.getEnclosedPage();
245 final WebRequest request = htmlPage.getWebResponse().getWebRequest();
246
247 // update request url with location.href in case hash was changed
248 request.setUrl(new URL(getHref()));
249 if (getBrowserVersion().hasFeature(JS_LOCATION_RELOAD_REFERRER)) {
250 request.setRefererHeader(htmlPage.getUrl());
251 }
252
253 webWindow.getWebClient().download(webWindow, "", request, false, null, "JS location.reload");
254 }
255
256 /**
257 * Reloads the window using the specified URL via a postponed action.

Callers

nothing calls this directly

Calls 12

getEnclosedPageMethod · 0.95
setUrlMethod · 0.95
getHrefMethod · 0.95
setRefererHeaderMethod · 0.95
getWebClientMethod · 0.95
downloadMethod · 0.80
getWebResponseMethod · 0.65
getUrlMethod · 0.65
getWebWindowMethod · 0.45
getWebRequestMethod · 0.45
hasFeatureMethod · 0.45
getBrowserVersionMethod · 0.45

Tested by

no test coverage detected