Ответ 1
Кажется, что единственный способ добавить это ретроактивно, через JS.
function allowModals(){
for (const i of document.getElementsByTagName('iframe')) {
if (!i.sandbox.supports('allow-modals')) {
console.warn("Your browser doesn't support the 'allow-modals' attribute :(");
break;
}
if (i.sandbox.contains('allow-modals')) continue;
console.info(i, "doesn't allow modals");
i.sandbox.add('allow-modals');
console.info(i, 'now allows modals');
}
}
<button onclick='allowModals()' style='display: block'>Allow modals</button>
<iframe src="//example.com"></iframe>