skyhirider · GitHub

If we want to implement our own way to handle print page requests, we need to override the Window class and inject to to whichever classes are using it.

Could this be made easier by calling the attachment handler and allowing us to define the behavior there, or implementing a print handler ?

The use case is that I would like to get the html of the page whenever print is called and save it. Custom logic is easy to implement, just need a reasonable place to insert it into.

Or is there an easy way to inject our own Window when setting up htmlunit config?

@JsxFunction
public void print() {
if (LOG.isDebugEnabled()) {
LOG.debug("window.print() not implemented");
}
}

Read the original on github.com ↗