У нас возникла проблема с функцией (createContextualFragment)
в сафари.CreateContextualFragment не работает в сафари
Нам нужно добавить контент в тело, поэтому мы используем эту строку кода.
Код:
document.getElementsByTagName('body')[0].insertBefore(document.createRange().createContextualFragment("<div></div><script src="LINK_SOURCE"></script>"), null);
Эта строка кода работает отлично с Chrome и Firefox, но у нас есть некоторые проблемы с createContextualFragment в Safari.
Ошибка в Safari:
createContextualFragment — asyncronousDocumentWrite2.html:28:115NotSupportedError: DOM Exception 9: The implementation did not support the requested type of object or operation.