diff --git a/common/components/protocols.js b/common/components/protocols.js index da602c2b..e925da69 100644 --- a/common/components/protocols.js +++ b/common/components/protocols.js @@ -3,7 +3,6 @@ // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. "use strict"; - function reportError(e) { dump("dactyl: protocols: " + e + "\n" + (e.stack || Error().stack)); Cu.reportError(e); @@ -61,11 +60,17 @@ function redirect(to, orig, time) { function Factory(clas) ({ __proto__: clas.prototype, createInstance: function (outer, iid) { - if (outer != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - if (!clas.instance) - clas.instance = new clas(); - return clas.instance.QueryInterface(iid); + try { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + if (!clas.instance) + clas.instance = new clas(); + return clas.instance.QueryInterface(iid); + } + catch (e) { + reportError(e); + throw e; + } } }); diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 092e698d..6e5645b2 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -728,8 +728,6 @@ config.INIT = update(Object.create(config.INIT), config.INIT, { endModule(); -config.loadStyles(); - } catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); } // vim: set fdm=marker sw=4 sts=4 et ft=javascript: diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index 756c0eca..7b73be7c 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -30,6 +30,8 @@ var Overlay = Module("Overlay", { init: function () { services["dactyl:"]; // Hack. Force module initialization. + config.loadStyles(); + util.overlayWindow(config.overlayChrome, function (window) ({ init: function (document) { /**