1(() => { 2 const isAlreadyIncluded = (type, key, { value, rel }) => 3 [...document.getElementsByTagName(type)].some(el => (el[key] === value && el.rel === rel)); 4 const crElem = (type, parent, attrObj = {}) => { 5 let elt = document.createElement(type); 6 for (let attr in attrObj) elt.setAttribute(attr, attrObj[attr]); 7 parent.appendChild(elt); 8 return elt; 9 }; 10 const crElemOnce = (type, parent, attrObj = {}) => { 11 const key = type === 'link' ? 'href' : 'src'; 12 if (!isAlreadyIncluded(type, key, { 13 value: attrObj[key], 14 rel: attrObj.rel, 15 })) crElem(type, parent, attrObj); 16 } 17 18 crElemOnce('link', document.head, { 19 'href': 'https://well.ru/local/modules/hotel.search/fonts/fa/css/all.css', 20 'as': 'style', 21 'rel': 'preload', 22 }); 23 crElemOnce('link', document.head, { 24 'href': 'https://well.ru/local/modules/hotel.search/fonts/fa/css/all.css', 25 'rel': 'stylesheet', 26 'charset': 'UTF-8' 27 }); 28 29 crElemOnce('link', document.head, { 30 'href': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap', 31 'as': 'style', 32 'rel': 'preload', 33 }); 34 crElemOnce('link', document.head, { 35 'href': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap', 36 'rel': 'stylesheet', 37 }); 38 39 crElemOnce('link', document.head, { 40 'href': 'https://unpkg.com/[email protected]/dist/leaflet.css', 41 'rel': 'stylesheet', 42 }); 43 crElemOnce('script', document.body, { 44 'src': 'https://unpkg.com/[email protected]/dist/leaflet.js', 45 'charset': 'UTF-8' 46 }); 47 crElem('script', document.body, { 48 'src': 'https://well.ru/local/modules/tour.vitrine/js/app.js?' + Date.now(), 49 'charset': 'UTF-8' 50 }); 51})()
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.