Stop loading resources from CDN - Part 3
TheFrenchGhosty TheFrenchGhosty@posteo.is
Tue, 14 Dec 2021 16:26:07 +0100
5 files changed,
6 insertions(+),
6 deletions(-)
M
scripts/script.js
→
scripts/script.js
@@ -1,4 +1,4 @@
-const blob = new Blob(['importScripts("scripts/lzma_worker.js");']); +const blob = new Blob(['importScripts("./scripts/lzma_worker.js");']); const lzma = new LZMA(window.URL.createObjectURL(blob)); let editor = null;@@ -16,7 +16,7 @@ initModals();
}; const initCodeEditor = () => { - CodeMirror.modeURL = 'scripts/CodeMirror/mode/%N/%N.js'; + CodeMirror.modeURL = '/scripts/CodeMirror/mode/%N/%N.js'; editor = new CodeMirror(byId('editor'), { lineNumbers: true, theme: 'dracula',@@ -283,7 +283,7 @@ }
}; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('scripts/sw.js'); + navigator.serviceWorker.register('/scripts/sw.js'); } init();
M
style/style.css
→
style/style.css
@@ -165,8 +165,8 @@
/* Fonts */ @font-face { font-family: 'JetBrainsMono'; - src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.210/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2'), - url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.210/fonts/ttf/JetBrainsMonoNL-Regular.ttf') format('truetype'); + src: url('./fonts/JetBrainsMono-Regular.woff2') format('woff2'), + url('./fonts/JetBrainsMonoNL-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; }@@ -176,7 +176,7 @@ font-family: 'Roboto';
font-style: normal; font-weight: 400; font-display: swap; - src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2'); + src: local('Roboto'), local('Roboto-Regular'), url(./fonts/Roboto-Regular.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }