Skip to content

Allowing easier overriding of window.print() behavior? #501

@skyhirider

Description

@skyhirider

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");
}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions