From 9611ba37389171ae1300a81b00b1a714c1f6e299 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 12 Oct 2014 20:55:45 -0700 Subject: [PATCH] GUAC-882: Use window.open("") to check for existing window, not window.open(null). --- guacamole/src/main/webapp/scripts/guac-ui.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/guac-ui.js b/guacamole/src/main/webapp/scripts/guac-ui.js index e1ac34b0a..462eb133b 100644 --- a/guacamole/src/main/webapp/scripts/guac-ui.js +++ b/guacamole/src/main/webapp/scripts/guac-ui.js @@ -146,13 +146,17 @@ GuacUI.openObject = function(id, parameters) { if (parameters) url += "&" + parameters; - // Attempt to focus existing window - var current = window.open(null, id); + // Attempt to pull existing window + var current = window.open("", id); // If window did not already exist, set up as // Guacamole client - if (!current.GuacUI) - window.open(url, id); + if (!current || !current.GuacUI) + current = window.open(url, id); + + // Focus (possibly) existing window + if (current) + current.focus(); };