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

Method confirm

src/main/java/org/htmlunit/javascript/host/Window.java:312–323  ·  view source on GitHub ↗

The JavaScript function confirm. @param message the message @return true if ok was pressed, false if cancel was pressed

(final String message)

Source from the content-addressed store, hash-verified

310 * @return true if ok was pressed, false if cancel was pressed
311 */
312 @JsxFunction
313 public boolean confirm(final String message) {
314 final ConfirmHandler handler = getWebWindow().getWebClient().getConfirmHandler();
315 if (handler == null) {
316 if (LOG.isWarnEnabled()) {
317 LOG.warn("window.confirm(\""
318 + message + "\") no confirm handler installed, simulating the OK button");
319 }
320 return true;
321 }
322 return handler.handleConfirm(document_.getPage(), message);
323 }
324
325 /**
326 * The JavaScript function {@code prompt}.

Callers

nothing calls this directly

Calls 7

getWebWindowMethod · 0.95
handleConfirmMethod · 0.95
getConfirmHandlerMethod · 0.80
getWebClientMethod · 0.65
isWarnEnabledMethod · 0.65
warnMethod · 0.65
getPageMethod · 0.65

Tested by

no test coverage detected