aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteramako2010-10-24 00:12:49 +0900
committerteramako2010-10-24 00:12:49 +0900
commit0fff631ab86f76a63e3a317cf74eb419a7c5380c (patch)
treea1351139179ab3cd325b21317c4ae37af01a428e
parent837be42975292d5a8747550beeb0773088b1247b (diff)
downloadvimperator-plugins-0fff631ab86f76a63e3a317cf74eb419a7c5380c.tar.bz2
supports both Firefox 4 and Firefox 3.6
-rw-r--r--inspector.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/inspector.js b/inspector.js
index 6ea0235..bf4bb6f 100644
--- a/inspector.js
+++ b/inspector.js
@@ -27,10 +27,18 @@ let INFO =
</item>
</plugin>;
-(function(){
const inspectorID = "inspector@mozilla.org";
-if (!Application.extensions.has(inspectorID) || !Application.extensions.get(inspectorID).enabled) return;
+if (AddonManager) {
+ AddonManager.getAddonByID(inspectorID, function(ext){
+ if (ext.isActive)
+ init();
+ });
+} else if (Application.extensions.has(inspectorID) && Application.extensions.get(inspectorID).enabled) {
+ init();
+}
+
+function init(){
/* これやるとFirefox終了時に実行されるんだけど...なぜ? -> Ubiquityが悪さしているみたい
Object.prototype.inspect = function(){
@@ -96,6 +104,6 @@ commands.addUserCommand(["inspect","dominspect"],"run DOM Inspector",
}
);
-})();
+}
// vim: sw=2 ts=2 et: