From fe3cff6bb656c5858856dd38a0e036049a8574ac Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Thu, 3 Jan 2013 09:52:19 +0900 Subject: [PATCH] Update UninstallationListener.js. --- .../res/UninstallationListener.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/treestyletab/res/UninstallationListener.js b/content/treestyletab/res/UninstallationListener.js index 92fceafa..c8fb7959 100644 --- a/content/treestyletab/res/UninstallationListener.js +++ b/content/treestyletab/res/UninstallationListener.js @@ -13,6 +13,24 @@ original: http://github.com/piroor/fxaddonlibs/blob/master/UninstallationListener.js */ + +/* To work as a JS Code Module */ +if (typeof window == 'undefined' || + (window && typeof window.constructor == 'function')) { + this.EXPORTED_SYMBOLS = ['UninstallationListener']; + + // If namespace.jsm is available, export symbols to the shared namespace. + // See: http://github.com/piroor/fxaddonlibs/blob/master/namespace.jsm + try { + let ns = {}; + Components.utils.import('resource://my-modules/namespace.jsm', ns); + /* var */ window = ns.getNamespaceFor('piro.sakura.ne.jp'); + } + catch(e) { + window = {}; + } +} + (function() { const currentRevision = 2; @@ -165,3 +183,7 @@ } }; })(); + +if (window != this) { // work as a JS Code Module + this.UninstallationListener = window['piro.sakura.ne.jp'].UninstallationListener; +}