Since Chrome 46 it is needed to add the 'allow-modals' flag to the sandbox attribute of an iframe to allow modals (like alert and confirm) to break out of the iframe. No problem so far.
But when you run that code in browsers that do not yet support the flag (like Safari or Chrome before version 46) you get the following error: Error while parsing the 'sandbox' attribute: 'allow-modals' is an invalid sandbox flag.
Anybody an idea how to fix this without some kind of browser sniffing?