MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / replaceState

Method replaceState

src/main/java/org/htmlunit/History.java:320–332  ·  view source on GitHub ↗

Allows to change history state and url if provided. @param state the new state to use @param url the new url to use

(final Object state, final URL url)

Source from the content-addressed store, hash-verified

318 * @param url the new url to use
319 */
320 public void replaceState(final Object state, final URL url) {
321 if (index_ >= 0 && index_ < entries_.size()) {
322 final HistoryEntry entry = entries_.get(index_);
323
324 Page page = entry.getPage();
325 if (page == null) {
326 page = window_.getEnclosedPage();
327 }
328
329 entry.setUrl(url, page);
330 entry.setState(state);
331 }
332 }
333
334 /**
335 * Allows to change history state and url if provided.

Callers

nothing calls this directly

Calls 6

getPageMethod · 0.95
setUrlMethod · 0.95
setStateMethod · 0.95
getEnclosedPageMethod · 0.65
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected