Make DOM Inspector and Venkman usable in debug builds (--enable-extensions=venkman,inspector is needed in the mozconfig file)
authorFlorian Quèze <florian@instantbird.org>
Fri, 22 Aug 2008 03:09:38 +0200
changeset 13770 5dc6bc1feb34dbf59b003be7542eca88790cda88
parent 13769 381e2c4e6decfc83fa14ca46da53762c39edefff
child 13771 0c9b75977da22873f58ed71de8f7c2de9bdb42e6
push id9778
push userflorian@queze.net
push dateSun, 12 Jan 2014 18:25:45 +0000
treeherdercomm-central@f81a23bfefcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Make DOM Inspector and Venkman usable in debug builds (--enable-extensions=venkman,inspector is needed in the mozconfig file)
im/base/content/debug/debug.js
im/base/content/debug/debug.xul
im/build.mk
--- a/im/base/content/debug/debug.js
+++ b/im/base/content/debug/debug.js
@@ -20,19 +20,34 @@ var debug = {
   config: function debug_config() {
     if (!menus.focus("Preferences:ConfigManager"))
       window.open(configWindow, "Config",
                   "chrome,resizable");
   },
 
   venkman: function debug_venkman() {
     start_venkman();
+  },
+
+  inspector: function debug_inspector() {
+    inspectDOMDocument();
+  },
+
+  load: function debug_load() {
+    setTimeout(function() {
+      // Load the Window DataSource so that browser windows opened subsequent to DOM
+      // Inspector show up in the DOM Inspector's window list.
+      var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
+                               .getService(Components.interfaces.nsIWindowDataSource);
+    }, 0);
   }
 };
 
+window.addEventListener("load", debug.load, false);
+
 function debug_enumerateProtocols()
 {
   dump("trying to enumerate protocols:\n");
   var pcs = Components.classes["@instantbird.org/purple/core;1"]
                       .getService(Ci.purpleICoreService);
   for (let proto in getIter(pcs.getProtocols, Ci.purpleIProtocol)) {
     dump(" " + proto.name + " " + proto.id + "\n");
     for (let opt in getIter(proto.getOptions, Ci.purpleIPref)) {
--- a/im/base/content/debug/debug.xul
+++ b/im/base/content/debug/debug.xul
@@ -1,17 +1,19 @@
 <?xml version="1.0"?>
 <overlay id="debug" 
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/x-javascript" src="chrome://debug/content/debug.js"/>
-  <script src="chrome://venkman/content/venkman-overlay.js"/>
+  <script type="application/x-javascript" src="chrome://venkman/content/venkman-overlay.js"/>
+  <script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
 
   <menubar id="blistMenubar">
     <menu label="Debug" id="debugMenu" insertafter="toolsMenu">
       <menupopup>
         <menuitem id="errorConsoleMenuItem" label="Error Console" oncommand="debug.errors()"/>
+        <menuitem id="domiMenuItem" label="DOM Inspector" oncommand="debug.inspector()"/>
         <menuitem id="venkmanMenuItem" label="Venkman" oncommand="debug.venkman()"/>
         <menuseparator/>
         <menuitem id="configMenuItem" label="about:config" oncommand="debug.config()"/>
       </menupopup>
     </menu>
   </menubar>
 </overlay>
--- a/im/build.mk
+++ b/im/build.mk
@@ -39,16 +39,20 @@
 ifndef COMM_BUILD
 
 ifndef LIBXUL_SDK
 include $(topsrcdir)/toolkit/toolkit-tiers.mk
 endif
 
 TIERS += app
 
+ifdef MOZ_EXTENSIONS
+tier_app_dirs += extensions
+endif
+
 else
 
 TIERS += app
 
 tier_app_dirs += \
   purple \
   instantbird \
   $(NULL)