"; const tempDiv = document.createElement('div'); tempDiv.innerHTML = html; const elements = Array.from(tempDiv.children); elements.forEach(function(el) { const name = el.getAttribute('name'); const prop = el.getAttribute('property'); if (name && !document.querySelector('meta[name="' + name + '"]')) { document.head.insertBefore(el, document.head.firstChild); } else if (prop && !document.querySelector('meta[property="' + prop + '"]')) { document.head.insertBefore(el, document.head.firstChild); } else if (!name && !prop) { document.head.insertBefore(el, document.head.firstChild); } }); })(); "; const tempDiv = document.createElement('div'); tempDiv.innerHTML = html; const elements = Array.from(tempDiv.children); elements.forEach(function(el) { const name = el.getAttribute('name'); const prop = el.getAttribute('property'); if (name && !document.querySelector('meta[name="' + name + '"]')) { document.head.insertBefore(el, document.head.firstChild); } else if (prop && !document.querySelector('meta[property="' + prop + '"]')) { document.head.insertBefore(el, document.head.firstChild); } else if (!name && !prop) { document.head.insertBefore(el, document.head.firstChild); } }); })();