From: Galen Charlton Date: Tue, 7 Feb 2017 17:32:05 +0000 (-0500) Subject: distinguish between XUL and Firefox when excluding XUL code from webstaff X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cfbf20ca63c71814c4d9ff503fd98fb793bf2396;p=working%2FEvergreen.git distinguish between XUL and Firefox when excluding XUL code from webstaff Signed-off-by: Galen Charlton --- 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;