From 0fff631ab86f76a63e3a317cf74eb419a7c5380c Mon Sep 17 00:00:00 2001 From: teramako Date: Sun, 24 Oct 2010 00:12:49 +0900 Subject: supports both Firefox 4 and Firefox 3.6 --- inspector.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'inspector.js') diff --git a/inspector.js b/inspector.js index 6ea0235..bf4bb6f 100644 --- a/inspector.js +++ b/inspector.js @@ -27,10 +27,18 @@ let INFO = ; -(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: -- cgit v1.2.3