mirror of https://gitlab.com/curben/blog
feat(js): remove SRI since 3rd-party libs are now served locally
This commit is contained in:
parent
713a6ef730
commit
b36b898a17
|
@ -46,9 +46,6 @@
|
||||||
|
|
||||||
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
|
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
|
||||||
|
|
||||||
<%/* Fallback function for SRI */%>
|
|
||||||
<%- js({ src: '/js/sri.min.js', 'async': true }) %>
|
|
||||||
|
|
||||||
<%/* CSS of Chameleon theme */%>
|
<%/* CSS of Chameleon theme */%>
|
||||||
<%- css('/css/chameleon.css') %>
|
<%- css('/css/chameleon.css') %>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
/*
|
|
||||||
* subresource-integrity-fallback
|
|
||||||
* https://github.com/JackuB/subresource-integrity-fallback
|
|
||||||
* Licensed MIT © Jakub Mikulas
|
|
||||||
*/
|
|
||||||
try{!function(){const t=window.resourceLoadError||(()=>{}),e="data-sri-fallback",r=window.MutationObserver||window.WebKitMutationObserver;r&&new r(function(t){t.forEach(function(t){t.addedNodes.forEach(i)})}).observe(document,{childList:!0,subtree:!0});const i=function(r){const i=(r.tagName||"").toLowerCase();"link"!==i&&"script"!==i||!r.integrity||r.getAttribute("data-sri-fallback-retry")||(r.onerror=function(o){if(r.getAttribute(e)){const o=document.createElement(i),n=r.parentNode;o.setAttribute("data-sri-fallback-retry","1"),o.setAttribute("integrity",r.integrity),r.src&&o.setAttribute("src",r.getAttribute(e)),r.href&&o.setAttribute("href",r.getAttribute(e)),o.onerror=function(e){t(e,!0)},n.appendChild(o),r.remove()}else t(o,!1)})}}()}catch(t){console.error(t)}
|
|
Loading…
Reference in New Issue