I have following font awesome reference
<link href="css/fontawesome-free-5.12.1-web/css/all.css" rel="stylesheet">
<script defer src="css/fontawesome-free-5.12.1-web/js/all.js"></script>
Alternatively I also have premium kit reference
<script src="https://kit.fontawesome.com/7xxxx.js" crossorigin="anonymous"></script>
Both references renders icons on Google Chrome, but fails to work on Safari (iOS) Console error says
NoModificationAllowedError: The object can not be modified
Here is the code all.js fontawesome library that is having issues
if (node.parentNode && node.outerHTML) {
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " -->") : '');
} else if (node.parentNode) {
var newNode = document.createElement('span');
node.parentNode.replaceChild(newNode, node);
newNode.outerHTML = newOuterHTML;
}
How can I make this work for safari?
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " -->") : '');
For some reason font-awesome
<i>
tag with font-awesome class inside SVG works on Chrome but not on safari.So I had to replace my code
Old code:
Replaced to:
JS Fiddle