Removed script file import

Combined both script.js and legacy.js into a single <script> tag on index.html.

The page uses less than 15 sloc of JS excluding the Service Worker.
This commit is contained in:
Victor Westerlund 2021-01-31 12:56:28 +01:00
parent a13b86765b
commit 4d74cc4607
4 changed files with 17 additions and 16 deletions

View file

@ -1,7 +0,0 @@
// Promote IE to Edge
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
window.location = 'microsoft-edge:' + window.location;
setTimeout(function() {
window.location = 'https://go.microsoft.com/fwlink/?linkid=2135547';
},1);
}

View file

@ -1,5 +0,0 @@
if(navigator.serviceWorker) {
navigator.serviceWorker.register("sw.js",{
scope: "/"
});
}

View file

@ -40,7 +40,21 @@
</picture>
</div>
</main>
<script src="assets/js/script.js" type="module"></script>
<script src="assets/js/legacy.js" nomodule></script>
<script>
// Promote IE to Edge
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
window.location = 'microsoft-edge:' + window.location;
setTimeout(function() {
window.location = 'https://go.microsoft.com/fwlink/?linkid=2135547';
},1);
}
// Register SW if supported by browser
if(navigator.serviceWorker) {
navigator.serviceWorker.register("sw.js",{
scope: "/"
});
}
</script>
</body>
</html>

View file

@ -1,4 +1,4 @@
const version = "1611341781";
const version = "1612093525";
const root = "/";
let activeCaches = [
@ -11,7 +11,6 @@ self.addEventListener("install", event => {
root + "index.html",
root + "assets/css/style.css",
root + "assets/img/favicon.png",
root + "assets/js/script.js",
root + "assets/img/pattern.gif",
root + "assets/fonts/RobotoMono-Bold.woff2",
root + "assets/fonts/RobotoMono-Regular.woff2"