Is there a way to verify if the window.print()
method is overridden using JavaScript and/or FirefoxDriver?
You can prevent all print buttons on a page from functioning like this:
window.print = function() { alert("Bazinga") }
When this is implemented, a normal "Print" link such as the one below will no longer work:
<a onclick="window.print()">....</a>
I am looking for a way to confirm whether a window.print()
call triggers the original print dialog.
Perhaps injecting some JavaScript into the FirefoxWebdriver could provide a solution?