Load namespace.jsm & pref.js as lazy getter.

This commit is contained in:
saneyuki_s 2013-01-04 13:06:20 +09:00
parent 6361cd71a1
commit ce9bd03e3c

View File

@ -41,11 +41,15 @@ const Ci = Components.interfaces;
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
Components.utils.import('resource://gre/modules/Services.jsm');
Components.utils.import('resource://treestyletab-modules/lib/prefs.js');
Components.utils.import('resource://treestyletab-modules/lib/namespace.jsm');
var window = getNamespaceFor('piro.sakura.ne.jp');
XPCOMUtils.defineLazyModuleGetter(this, 'Deferred', 'resource://treestyletab-modules/lib/jsdeferred.js');
XPCOMUtils.defineLazyGetter(this, 'window', function() {
Cu.import('resource://treestyletab-modules/lib/namespace.jsm');
return getNamespaceFor('piro.sakura.ne.jp');
});
XPCOMUtils.defineLazyGetter(this, 'prefs', function() {
Cu.import('resource://treestyletab-modules/lib/prefs.js');
return window['piro.sakura.ne.jp'].prefs;
});
XPCOMUtils.defineLazyGetter(this, 'jstimer', function() {
var jstimer = {};
Components.utils.import('resource://treestyletab-modules/lib/jstimer.jsm', jstimer);