mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Start UI and connection only after control returns from body onload (otherwise, browser will always thing page is loading).
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="styles/client.css"/>
|
<link rel="stylesheet" type="text/css" href="styles/client.css"/>
|
||||||
<link rel="stylesheet" type="text/css" href="styles/keyboard.css"/>
|
<link rel="stylesheet" type="text/css" href="styles/keyboard.css"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||||
<title>Guacamole ${project.version}</title>
|
<title>Guacamole ${project.version}</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -95,29 +96,37 @@
|
|||||||
<!-- Init -->
|
<!-- Init -->
|
||||||
<script type="text/javascript"> /* <![CDATA[ */
|
<script type="text/javascript"> /* <![CDATA[ */
|
||||||
|
|
||||||
// Instantiate client
|
// Start connect after control returns from onload (allow browser
|
||||||
var guac = new Guacamole.Client(
|
// to consider the page loaded).
|
||||||
GuacamoleUI.display,
|
document.body.onload = function() {
|
||||||
new Guacamole.HTTPTunnel("tunnel")
|
|
||||||
);
|
|
||||||
|
|
||||||
// Tie UI to client
|
window.setTimeout(function() {
|
||||||
GuacamoleUI.attach(guac);
|
// Instantiate client
|
||||||
|
var guac = new Guacamole.Client(
|
||||||
|
GuacamoleUI.display,
|
||||||
|
new Guacamole.HTTPTunnel("tunnel")
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
// Tie UI to client
|
||||||
|
GuacamoleUI.attach(guac);
|
||||||
|
|
||||||
// Get ID
|
try {
|
||||||
var id = window.location.search.substring(1);
|
|
||||||
|
|
||||||
// Connect client
|
// Get ID
|
||||||
guac.connect("id=" + id);
|
var id = window.location.search.substring(1);
|
||||||
|
|
||||||
}
|
// Connect client
|
||||||
catch (e) {
|
guac.connect("id=" + id);
|
||||||
GuacamoleUI.showError(e.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ]]> */ </script>
|
}
|
||||||
|
catch (e) {
|
||||||
|
GuacamoleUI.showError(e.message);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ]]> */ </script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user