feat(js): remove SRI since 3rd-party libs are now served locally

This commit is contained in:
MDLeom 2020-04-08 01:05:33 +01:00
parent 713a6ef730
commit b36b898a17
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
2 changed files with 0 additions and 9 deletions

View File

@ -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') %>

View File

@ -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)}