Is there a way using JavaScript or jQuery to detect if a confirm or alert box is being displayed?
Confirm and alert boxes are blocking events - Javascript code execution is halted while these are displayed. So no - you can not detect if one is currently being displayed, as far as I know.