FUEL/STEELベースにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6684 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-06-22 09:52:18 +00:00
parent 0baac4cc62
commit 6870f26741

View File

@ -23,16 +23,20 @@ const Ci = Components.interfaces;
const currentRevision = 1; const currentRevision = 1;
var hiddenWindow = Cc['@mozilla.org/appshell/appShellService;1'] const Application = '@mozilla.org/fuel/application;1' in Cc ?
.getService(Ci.nsIAppShellService) Cc['@mozilla.org/fuel/application;1'].getService(Ci.fuelIApplication) :
.hiddenDOMWindow; '@mozilla.org/steel/application;1' in Cc ?
Cc['@mozilla.org/steel/application;1'].getService(Ci.steelIApplication) :
null ;
if (!Application)
throw new Error('there is no backend for shared namespaces!');
if (!('piro.sakura.ne.jp' in hiddenWindow)) const storage = Application.storage;
hiddenWindow['piro.sakura.ne.jp'] = {};
var namespaces = hiddenWindow['piro.sakura.ne.jp'].sharedNameSpaces || {}; if (!storage.has('sharednamespaces@piro.sakura.ne.jp'))
if (!('sharedNameSpaces' in hiddenWindow['piro.sakura.ne.jp'])) storage.set('sharednamespaces@piro.sakura.ne.jp', {});
hiddenWindow['piro.sakura.ne.jp'].sharedNameSpaces = namespaces;
var namespaces = storage.get('sharednamespaces@piro.sakura.ne.jp', null);
function getNamespaceFor(aName) function getNamespaceFor(aName)
{ {