We are using
window.confirm() in the JS parts of Lightning Aura Components and embedded Visualforce pages (iframed).
This worked just fine for several years.
Yesterday I noticed that in both use cases some suppression has started to kick-in: when I click on something which is invoking
window.confirm() and only proceeds when the user clicks "Yes", simply nothing happens. No popup is showing up. Hence, no "Yes" could ever be clicked. Leading to broken functionality :-(
Now it comes: this happens only sometimes - not always. I've found no reproducible example. It feels actually just random. Same code, even the same record, same browser, same settings - I would say same everything. Sometimes it works, sometimes it does not... strange... it feels like quantum physics...
Inspecting the console, I found this (in case it does not work):
Ignored call to 'confirm()'. The document is sandboxed, and the 'allow-modals' keyword is not set.
So sometimes it looks like this (unwanted and harming behaviour):
But should look like this:
I know that alert() popups are not the very best way to interact with the user. On the other hand they are also not that bad and especially via iframed Visualforce page it is by far the easiest way to tunnel a popup to LEX. Also for silly Yes | No questions, window.confirm() is mostly good enough to rock the show.
So why this started to happen?
And why it works sometimes and sometimes it bugs?