From 23568fd058fc47f1e180aaac6dff6266d7ef98d6 Mon Sep 17 00:00:00 2001 From: mooz Date: Tue, 6 Jul 2010 23:45:25 +0900 Subject: [PATCH] Support Firefox 4.0 --- chrome.manifest | 4 ++++ chrome.manifest.pack | 4 ++++ components/keysnail-loader.js | 24 +++++++++++++++++++----- install.rdf | 4 ++-- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/chrome.manifest b/chrome.manifest index 245907a..65cac22 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -10,3 +10,7 @@ resource keysnail-share share/ resource keysnail-scheme schemes/ overlay chrome://browser/content/browser.xul chrome://keysnail/content/browser.xul + +component {ed3f874d-1b4d-40f2-a19a-e424156ac49b} components/keysnail-loader.js +contract @github.com/mooz/keysnail/loader;1 {ed3f874d-1b4d-40f2-a19a-e424156ac49b} +category profile-after-change @github.com/mooz/keysnail/loader;1 @github.com/mooz/keysnail/loader;1 diff --git a/chrome.manifest.pack b/chrome.manifest.pack index 8b486f4..e8dfcee 100644 --- a/chrome.manifest.pack +++ b/chrome.manifest.pack @@ -9,3 +9,7 @@ resource keysnail-share share/ resource keysnail-scheme schemes/ overlay chrome://browser/content/browser.xul chrome://keysnail/content/browser.xul + +component {ed3f874d-1b4d-40f2-a19a-e424156ac49b} components/keysnail-loader.js +contract @github.com/mooz/keysnail/loader;1 {ed3f874d-1b4d-40f2-a19a-e424156ac49b} +category profile-after-change @github.com/mooz/keysnail/loader;1 @github.com/mooz/keysnail/loader;1 diff --git a/components/keysnail-loader.js b/components/keysnail-loader.js index 284466b..7161c33 100644 --- a/components/keysnail-loader.js +++ b/components/keysnail-loader.js @@ -14,7 +14,12 @@ const CID = Components.ID('{ed3f874d-1b4d-40f2-a19a-e424156ac49b}'); const CONTRACT_ID = '@github.com/mooz/keysnail/loader;1'; const CLASS_NAME = 'KeySnail Loader'; -const STARTUP_TOPIC = 'app-startup'; +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +if (XPCOMUtils.generateNSGetFactory) + var STARTUP_TOPIC = 'profile-after-change'; // for gecko 2.0 +else + var STARTUP_TOPIC = 'app-startup'; function loadScript(path, context) { const loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] @@ -158,7 +163,11 @@ KeySnailLoader.prototype = { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; - } + }, + + classDescription: CLASS_NAME, + contractID: CONTRACT_ID, + classID: CID }; var module = { @@ -206,6 +215,11 @@ var module = { } }; -function NSGetModule(aCompMgr, aFileSpec) { - return module; -} +// function NSGetModule(aCompMgr, aFileSpec) { +// return module; +// } + +if (XPCOMUtils.generateNSGetFactory) + var NSGetFactory = XPCOMUtils.generateNSGetFactory([KeySnailLoader]); +else + var NSGetModule = function (aCompMgr, aFileSpec) { return module; }; diff --git a/install.rdf b/install.rdf index 34283da..a2688a6 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ keysnail@mooz.github.com 2 - 1.6.2 + 1.6.3 KeySnail mooz mooz @@ -32,7 +32,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.0 - 3.7a5pre + 4.0b2pre