MediaWiki:Common.js: различия между версиями
ограничим минимальные размеры? |
добавим блок отработки ошибок+безопасности больше |
||
| Строка 167: | Строка 167: | ||
iframe.style.maxWidth = '100%'; | iframe.style.maxWidth = '100%'; | ||
iframe.setAttribute('sandbox', 'allow-scripts allow- | iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin'); | ||
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin'); | iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin'); | ||
iframe.setAttribute('loading', 'lazy'); | |||
iframe.setAttribute('importance', 'low'); | |||
iframe.addEventListener('error', function() { | |||
console.error('Rutube iframe failed to load:', videoId); | |||
if (embed.parentNode) { | |||
embed.innerHTML = '<p style="padding: 20px; text-align: center; color: #666;">Не удалось загрузить видео</p>'; | |||
} | |||
}); | |||
while (embed.firstChild) { | while (embed.firstChild) { | ||
embed.removeChild(embed.firstChild); | embed.removeChild(embed.firstChild); | ||