GUAC-882: Tolerate lack of access to window.opener.

This commit is contained in:
Michael Jumper
2014-10-12 21:09:41 -07:00
parent 9611ba3738
commit f0087b27b0

View File

@@ -23,7 +23,18 @@
/** /**
* Global storage for Guacamole pages. * Global storage for Guacamole pages.
*/ */
GuacamoleSessionStorage = (opener && opener.GuacamoleSessionStorage) || new (function() { GuacamoleSessionStorage = (function() {
// Retrieve storage from owner of window, if possible
var opener_storage = null;
try {
opener_storage = opener && opener.GuacamoleSessionStorage;
}
catch (e) {}
return opener_storage;
})() || new (function() {
/** /**
* The contents of storage, as a JSON string containing name/value pairs as * The contents of storage, as a JSON string containing name/value pairs as