summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-27 14:57:53 +0200
committerGitHub <noreply@github.com>2021-04-27 14:57:53 +0200
commit2a1f3c494421e1cf1a675be339dbe0227ebe28da (patch)
treeea64f39ae6ad575ecddd6fb4231313bb4710b235 /misc
parent27548a36943a5ce98e30893524f54f7248e001c2 (diff)
parent88c060b00d53d1eb81a5f028bb187feb6118d5ff (diff)
Merge pull request #48159 from Faless/js/4.x_pwa_export
[HTML5] Export as Progressive Web App
Diffstat (limited to 'misc')
-rw-r--r--misc/dist/html/offline-export.html42
-rw-r--r--misc/dist/html/service-worker.js17
2 files changed, 45 insertions, 14 deletions
diff --git a/misc/dist/html/offline-export.html b/misc/dist/html/offline-export.html
new file mode 100644
index 0000000000..41ab42b04b
--- /dev/null
+++ b/misc/dist/html/offline-export.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>You are offline</title>
+ <style>
+ html {
+ background-color: #000000;
+ color: #ffffff;
+ }
+
+ body {
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+ margin: 2rem;
+ }
+
+ p {
+ margin-block: 1rem;
+ }
+
+ button {
+ display: block;
+ padding: 1rem 2rem;
+ margin: 3rem auto 0;
+ }
+ </style>
+</head>
+<body>
+ <h1>You are offline</h1>
+ <p>This application requires an Internet connection to run for the first time.</p>
+ <p>Press the button below to try reloading:</p>
+ <button type="button">Reload</button>
+
+ <script>
+ document.querySelector("button").addEventListener("click", () => {
+ window.location.reload();
+ });
+ </script>
+</body>
+</html>
diff --git a/misc/dist/html/service-worker.js b/misc/dist/html/service-worker.js
index d4eaed2b17..f8dee8cd5b 100644
--- a/misc/dist/html/service-worker.js
+++ b/misc/dist/html/service-worker.js
@@ -5,22 +5,11 @@
// previously cached resources to be updated from the network.
const CACHE_VERSION = "@GODOT_VERSION@";
const CACHE_NAME = "@GODOT_NAME@-cache";
-const OFFLINE_URL = "offline.html";
+const OFFLINE_URL = "@GODOT_OFFLINE_PAGE@";
// Files that will be cached on load.
-const CACHED_FILES = [
- "godot.tools.html",
- "offline.html",
- "godot.tools.js",
- "godot.tools.worker.js",
- "godot.tools.audio.worklet.js",
- "logo.svg",
- "favicon.png",
-];
-
+const CACHED_FILES = @GODOT_CACHE@;
// Files that we might not want the user to preload, and will only be cached on first load.
-const CACHABLE_FILES = [
- "godot.tools.wasm",
-];
+const CACHABLE_FILES = @GODOT_OPT_CACHE@;
const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES);
self.addEventListener("install", (event) => {