You can't. If you could, it would be trivial for malicious sites to trick users into thinking that the dialog was a system-level message.
Also,
showModalDialog
was removed
from Chrome in 2014[
^], and
from Firefox in 2017[
^]. It's deprecated in IE11, and not supported in Microsoft Edge. There are various options to replace this deprecated method - for example, these
two[
^]
polyfills[
^].