GUAC-882: Use window.open("") to check for existing window, not window.open(null).

This commit is contained in:
Michael Jumper
2014-10-12 20:55:45 -07:00
parent 5731cb6b34
commit 9611ba3738

View File

@@ -146,13 +146,17 @@ GuacUI.openObject = function(id, parameters) {
if (parameters) if (parameters)
url += "&" + parameters; url += "&" + parameters;
// Attempt to focus existing window // Attempt to pull existing window
var current = window.open(null, id); var current = window.open("", id);
// If window did not already exist, set up as // If window did not already exist, set up as
// Guacamole client // Guacamole client
if (!current.GuacUI) if (!current || !current.GuacUI)
window.open(url, id); current = window.open(url, id);
// Focus (possibly) existing window
if (current)
current.focus();
}; };