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

Method openDialogWindow

src/main/java/org/htmlunit/WebClient.java:1221–1241  ·  view source on GitHub ↗

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Opens a new dialog window. @param url the URL of the document to load and display @param opener the web window that is opening the dialog @param dialogArguments the object to make available in

(final URL url, final WebWindow opener, final Object dialogArguments)

Source from the content-addressed store, hash-verified

1219 * @throws IOException if there is an IO error
1220 */
1221 public DialogWindow openDialogWindow(final URL url, final WebWindow opener, final Object dialogArguments)
1222 throws IOException {
1223
1224 WebAssert.notNull("url", url);
1225 WebAssert.notNull("opener", opener);
1226
1227 final DialogWindow window = new DialogWindow(this, dialogArguments);
1228
1229 final HtmlPage openerPage = (HtmlPage) opener.getEnclosedPage();
1230 final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(),
1231 getBrowserVersion().getAcceptEncodingHeader());
1232 request.setCharset(UTF_8);
1233
1234 if (openerPage != null) {
1235 request.setRefererHeader(openerPage.getUrl());
1236 }
1237
1238 getPage(window, request);
1239
1240 return window;
1241 }
1242
1243 /**
1244 * Sets the object that will be used to create pages. Set this if you want

Callers

nothing calls this directly

Calls 9

notNullMethod · 0.95
getBrowserVersionMethod · 0.95
setCharsetMethod · 0.95
setRefererHeaderMethod · 0.95
getPageMethod · 0.95
getHtmlAcceptHeaderMethod · 0.80
getEnclosedPageMethod · 0.65
getUrlMethod · 0.65

Tested by

no test coverage detected