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

Method setUrl

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

Sets this location's URL, triggering a server hit and loading the resultant document into this location's window. @param url This location's new URL @throws IOException if there is a problem loading the new location

(final URL url)

Source from the content-addressed store, hash-verified

597 * @throws IOException if there is a problem loading the new location
598 */
599 private void setUrl(final URL url) throws IOException {
600 final WebWindow webWindow = window_.getWebWindow();
601 final BrowserVersion browserVersion = webWindow.getWebClient().getBrowserVersion();
602
603 final WebRequest webRequest = new WebRequest(url,
604 browserVersion.getHtmlAcceptHeader(), browserVersion.getAcceptEncodingHeader());
605 webRequest.setRefererHeader(getUrl());
606
607 webWindow.getWebClient().getPage(webWindow, webRequest);
608 }
609
610 /**
611 * Returns the {@code origin} property.

Callers 7

setSearchMethod · 0.95
setHostnameMethod · 0.95
setHostMethod · 0.95
setPathnameMethod · 0.95
setPortMethod · 0.95
setProtocolMethod · 0.95

Calls 8

getWebClientMethod · 0.95
getHtmlAcceptHeaderMethod · 0.95
setRefererHeaderMethod · 0.95
getUrlMethod · 0.95
getPageMethod · 0.65
getWebWindowMethod · 0.45
getBrowserVersionMethod · 0.45

Tested by

no test coverage detected