# Original Files:
#
# https://gitlab.freedesktop.org/spice/spice-html5/-/blob/9c8377f86c3423010e5705861429761074ed63e2/spice.css
# https://gitlab.freedesktop.org/spice/spice-html5/-/blob/9c8377f86c3423010e5705861429761074ed63e2/spice_auto.html 
#

diff -ruN /usr/share/spice-html5.old/spice.css /usr/share//spice-html5/spice.css
--- /usr/share/spice-html5.old/spice.css	2024-03-15 14:52:16.490847020 -0400
+++ /usr/share//spice-html5/spice.css	2024-03-15 09:58:50.421275329 -0400
@@ -165,4 +165,20 @@
 }
 .spice-message-error {
     color: red;
-}
\ No newline at end of file
+}
+.pw_prompt {
+    position:fixed;
+    left: 50%;
+    top:50%;
+    margin-left:-100px;
+    padding:15px;
+    width:200px;
+    border:1px solid black;
+}
+.pw_prompt label {
+    display:block; 
+    margin-bottom:5px;
+}
+.pw_prompt input {
+    margin-bottom:10px;
+}
diff -ruN /usr/share/spice-html5.old/spice_auto.html /usr/share//spice-html5/spice_auto.html
--- /usr/share/spice-html5.old/spice_auto.html	2024-03-15 14:52:16.490847020 -0400
+++ /usr/share//spice-html5/spice_auto.html	2024-03-15 10:11:47.128371995 -0400
@@ -50,6 +50,44 @@
             var host = null, port = null;
             var sc;
 
+	    var promptCount = 0;
+	    window.pw_prompt = function(options) {
+    		var lm = options.lm || "Password:",
+        	bm = options.bm || "Submit";
+    		if(!options.callback) { 
+        		alert("No callback function provided! Please provide one.") 
+   	    	};
+
+    	        var prompt = document.createElement("div");
+    	        prompt.className = "pw_prompt";
+
+    		var submit = function() {
+        		options.callback(input.value);
+       	 		document.body.removeChild(prompt);
+    		};
+
+   		var label = document.createElement("label");
+    		label.textContent = lm;
+    		label.for = "pw_prompt_input" + (++promptCount);
+    		prompt.appendChild(label);
+
+    		var input = document.createElement("input");
+    		input.id = "pw_prompt_input" + (promptCount);
+    		input.type = "password";
+    		input.addEventListener("keyup", function(e) {
+       			if (e.keyCode == 13) submit();
+    		}, false);
+    		prompt.appendChild(input);
+
+    		var button = document.createElement("button");
+    		button.textContent = bm;
+    		button.addEventListener("click", submit, false);
+    		prompt.appendChild(button);
+
+  		document.body.appendChild(prompt);
+	    };
+
+
             function spice_set_cookie(name, value, days) {
                 var date, expires;
                 date = new Date();
@@ -70,8 +108,12 @@
             {
                 disconnect();
                 if (e !== undefined && e.message === "Permission denied.") {
-                  var pass = prompt("My Password");
-                  connect(pass);
+		  pw_prompt({
+    		  	lm:"Please enter your password:",
+    		  	callback: function(password) {
+				connect(password);
+    		 	 }
+	          });
                 }
             }
 
