I have a question that may seem slightly vague, but I am not sure how to go about solving it.
Our office runs a headless machine that is a print server, connect via third party software. The issue that I am having, is that if for whatever reason, the system becomes disconnected from the host server, by means of connection issues on either our end, or theirs, an Alert dialog appears, and the printing will be halted until the dialog is dismissed.
The application is run through Internet Explorer, and appears with with the following dialog.
I originally tries using Java, and a Robot
to blindly click the okay button, however the issue is that the dialog will appear in different places each time, and sometimes the message will appear multiple times if not dismissed immediately, so blindly clicking a screen coordinate will not work.
My next thought was to search for a PID, and kill each message by name, or PID, however because it is an Internet Explorer application, that is not a possibility.
Any thoughts as to how I could blindly dismiss these messages, either automatically, or through an external signal?
Edit
I have determined that the dialog is created using JavaScript
, and I now have an alteration to the question, how can I dismiss this alert()
call? I have read that using JavaScript, you can not dismiss the message, but would there be a way to inject a custom script, to overrride the call to alert?
i.e., a dead function that overrides the system alert?
function alert(){
// do nothing
}
How could I append this to the already loaded page...?