diff options
author | teramako | 2010-10-24 00:12:49 +0900 |
---|---|---|
committer | teramako | 2010-10-24 00:12:49 +0900 |
commit | 0fff631ab86f76a63e3a317cf74eb419a7c5380c (patch) | |
tree | a1351139179ab3cd325b21317c4ae37af01a428e | |
parent | 837be42975292d5a8747550beeb0773088b1247b (diff) | |
download | vimperator-plugins-0fff631ab86f76a63e3a317cf74eb419a7c5380c.tar.bz2 |
supports both Firefox 4 and Firefox 3.6
-rw-r--r-- | inspector.js | 14 |
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: |