Эх сурвалжийг харах

Added new loading screen for Browser

Toby Chui 3 жил өмнө
parent
commit
92b62643b5

+ 0 - 0
web/Browser/canvas.html


+ 10 - 3
web/Browser/index.html

@@ -9,7 +9,7 @@
 		<script src="../script/jquery.min.js"></script>
 		<script src="../script/ao_module.js"></script>
 		<script src="../script/semantic/semantic.min.js"></script>
-		
+		<link rel="icon" type="image/png" href="img/module_icon.png">
 		<link rel="manifest" crossorigin="use-credentials" href="manifest.json">
 		<title>Browser</title>
 		<style>
@@ -201,6 +201,14 @@
 					return;
 				}
 
+				//Remove the tailing / if exists
+				if (targetURL.substr(targetURL.length - 1, targetURL.length) == "/"){
+					targetURL = targetURL.substr(0, targetURL.length - 1);
+				}
+
+				$("#xframe").removeAttr("srcdoc");
+				$("#xframe").attr("src", "loading.html");
+
 				//Filter the URL if required
 				if (targetURL.substr(0,4) != "http"){
 					if (location.protocol !== "https:"){
@@ -265,8 +273,7 @@
 						callback(null);
 					}
 					
-					
-					if (xFrameOptions.header == "sameorigin" || xFrameOptions.header == "deny"){
+					if (header == "sameorigin" || header == "deny"){
 						//This webpage do not allow iframeing
 						callback(false, location);
 					}else{

+ 16 - 0
web/Browser/loading.html

@@ -0,0 +1,16 @@
+<html>
+    <head>
+        <link rel="stylesheet" href="../script/semantic/semantic.min.css">
+        <style>
+            body{
+                height: 100vh;
+                width: 100%;
+            }
+        </style>
+    </head>
+    <body>
+        <div class="ui active inverted dimmer">
+            <div class="ui indeterminate text loader"></div>
+        </div>
+    </body>
+</html>