mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
FIX: Not all browsers send onreadystatechange for new data (Opera doesn't)
This commit is contained in:
@@ -295,6 +295,7 @@ function GuacamoleClient(display, tunnelURL) {
|
||||
|
||||
function handleResponse(xmlhttprequest) {
|
||||
|
||||
var interval = null;
|
||||
var nextRequest = null;
|
||||
|
||||
var instructionStart = 0;
|
||||
@@ -310,6 +311,12 @@ function GuacamoleClient(display, tunnelURL) {
|
||||
if (xmlhttprequest.readyState == 3 ||
|
||||
xmlhttprequest.readyState == 4) {
|
||||
|
||||
// Also poll every 30ms (some browsers don't repeatedly call onreadystatechange for new data)
|
||||
if (xmlhttprequest.readyState == 3 && interval == null)
|
||||
interval = setInterval(parseResponse, 30);
|
||||
else if (xmlhttprequest.readyState == 4 && interval != null)
|
||||
clearInterval(interval);
|
||||
|
||||
// Halt on error during request
|
||||
if (xmlhttprequest.status == 0) {
|
||||
showError("Request canceled by browser.");
|
||||
|
Reference in New Issue
Block a user