How to resolve the "A different origin subframe tried to create a JavaScript dialog" warning in Chrome?

Viewed 2175

I'm getting this warning in Chrome when I try to show a dialog (alert()/confirm()/prompt()) from an iframe. Both domains belong to me.

A different origin subframe tried to create a JavaScript dialog. This is no longer allowed and was blocked. See https://www.chromestatus.com/feature/5148698084376576 for more details.

Could I resolve this via .htaccess or with an HTTP header or anything like that?

1 Answers

Use top.alert(), top.confirm(), & top.prompt() instead, which, if you have your CORS set up, will use the parent window's (if there is one) dialogs which are not blocked by this Chrome update.

Related