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

Method setUrl

src/main/java/org/htmlunit/History.java:102–121  ·  view source on GitHub ↗
(final URL url, final Page page)

Source from the content-addressed store, hash-verified

100 }
101
102 void setUrl(final URL url, final Page page) {
103 if (url != null) {
104 WebWindow webWindow = null;
105 if (page != null) {
106 webWindow = page.getEnclosingWindow();
107 }
108
109 final URL encoded = UrlUtils.encodeUrl(url, webRequest_.getCharset());
110 webRequest_.setUrl(encoded);
111 if (page != null) {
112 page.getWebResponse().getWebRequest().setUrl(encoded);
113 if (webWindow != null) {
114 final Window win = webWindow.getScriptableObject();
115 if (win != null) {
116 win.getLocation().setHash(null, encoded.getRef(), false);
117 }
118 }
119 }
120 }
121 }
122
123 /**
124 * @return the state object

Callers 3

replaceStateMethod · 0.95
pushStateMethod · 0.95
goToUrlAtCurrentIndexMethod · 0.45

Calls 8

encodeUrlMethod · 0.95
getScriptableObjectMethod · 0.95
getLocationMethod · 0.95
getEnclosingWindowMethod · 0.65
getWebResponseMethod · 0.65
getCharsetMethod · 0.45
getWebRequestMethod · 0.45
setHashMethod · 0.45

Tested by

no test coverage detected