From 51484028fd352340b02d53c3aa7c6dd5e49ddd84 Mon Sep 17 00:00:00 2001
From: Fabio Alessandrelli
Date: Sat, 17 Sep 2022 11:33:53 +0200
Subject: [Web] Add missing features warning in editor and export shell.
---
misc/dist/html/editor.html | 35 +++++++++++++++--------------------
misc/dist/html/full-size.html | 6 ++++--
2 files changed, 19 insertions(+), 22 deletions(-)
(limited to 'misc/dist')
diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html
index 7c44dd45a1..ac00270d50 100644
--- a/misc/dist/html/editor.html
+++ b/misc/dist/html/editor.html
@@ -259,31 +259,20 @@
>Web editor documentation for usage instructions and limitations.
-
+
- The web server does not support cross-origin isolation,
- which is required for the Godot Web Editor to function.
-
-
- Reasons for cross-origin isolation being disabled:
-
- -
- This page is not served from a secure context (HTTPS or localhost).
-
- -
- This page may not be served with cross-origin isolation headers
- (check with the developer tools' Network tab).
-
+ The following features required by the Godot Web Editor are missing:
+
If you are self-hosting the web editor,
refer to
Exporting for the Web - Threads for more information.
+ >Exporting for the Web for more information.
@@ -394,16 +383,22 @@
});
}
- if (!crossOriginIsolated) {
+ const missing = Engine.getMissingFeatures();
+ if (missing.length) {
// Display error dialog as threading support is required for the editor.
setButtonEnabled('startButton', false);
document.getElementById("welcome-modal-description").style.display = "none";
- document.getElementById("welcome-modal-description-no-cross-origin-isolation").style.display = "block";
+ document.getElementById("welcome-modal-missing-description").style.display = "block";
document.getElementById("welcome-modal-dismiss").style.display = "none";
- document.getElementById("welcome-modal-reason-not-secure").style.display = window.isSecureContext ? "none" : "list-item";
+ const list = document.getElementById("welcome-modal-missing-list");
+ for (let i = 0; i < missing.length; i++) {
+ const node = document.createElement("li");
+ node.innerText = missing[i];
+ list.appendChild(node);
+ }
}
- if (!crossOriginIsolated || localStorage.getItem("welcomeModalDismissed") !== 'true') {
+ if (missing.length || localStorage.getItem("welcomeModalDismissed") !== 'true') {
document.getElementById("welcome-modal").style.display = "block";
document.getElementById("welcome-modal-dismiss").focus();
}
diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html
index f385b82f1d..d5b0050cfd 100644
--- a/misc/dist/html/full-size.html
+++ b/misc/dist/html/full-size.html
@@ -215,8 +215,10 @@ $GODOT_HEAD_INCLUDE
initializing = false;
};
- if (!Engine.isWebGLAvailable()) {
- displayFailureNotice('WebGL not available');
+ const missing = Engine.getMissingFeatures();
+ if (missing.length !== 0) {
+ const missingMsg = 'Warning!\nThe following features required to run Godot projects on the Web are missing:\n';
+ displayFailureNotice(missingMsg + missing.join("\n"));
} else {
setStatusMode('indeterminate');
engine.startGame({
--
cgit v1.2.3