From 64d4167d8f04afef189d35667c17745d2e9e785c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 7 Feb 2017 12:32:05 -0500 Subject: [PATCH] distinguish between XUL and Firefox when excluding XUL code from webstaff Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- Open-ILS/web/js/dojo/openils/XUL.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/XUL.js b/Open-ILS/web/js/dojo/openils/XUL.js index 459681f264..47021d2658 100644 --- a/Open-ILS/web/js/dojo/openils/XUL.js +++ b/Open-ILS/web/js/dojo/openils/XUL.js @@ -4,11 +4,16 @@ if(!dojo._hasResource["openils.XUL"]) { dojo.declare('openils.XUL', null, {}); openils.XUL.Component_copy; - try { - openils.XUL.Component_copy = Components; - } catch (e) { - openils.XUL.Component_copy = null; - }; + if (!window.IAMBROWSER) { + // looks like Firefox also exposes 'Components', so its + // existence is not sufficient check of XUL-ness + try { + if (Components.classes) + openils.XUL.Component_copy = Components; + } catch (e) { + openils.XUL.Component_copy = null; + }; + } openils.XUL.isXUL = function() { if(location.protocol == 'chrome:' || location.protocol == 'oils:') return true; -- 2.43.2