Permalink
Browse files

Append 1.9 trace console

  • Loading branch information...
1 parent 17469ef commit 8577541f650799e517e864540078324bece9afa7 @janodvarko janodvarko committed Apr 12, 2012
Showing 592 changed files with 188,067 additions and 0 deletions.
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>(firebug) Firebug Tracing</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
@@ -0,0 +1,3 @@
+VERSION=1.9
+RELEASE=b4
+GETFIREBUG=../../../../../../getfirebug.com/tags/production
View
@@ -0,0 +1,110 @@
+<?xml version="1.0" ?>
+
+<!-- In order to build the extension run: $ant build (in the extension dir)
+ The final xpi file should be located in a release directory -->
+<project name="tracingConsole" basedir="." default="build">
+
+ <!-- Properties -->
+ <property file="ant.properties"/>
+
+ <!-- Directories -->
+ <property name="build.dir" value="release"/>
+ <property name="deploy-xpi.dir" value="${GETFIREBUG}/releases/fbtrace/${VERSION}"/>
+
+ <available file="${GETFIREBUG}" property="deploy.dir.available"/>
+
+ <!-- Clean -->
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <!-- Build -->
+ <target name="build" depends="clean">
+
+ <!-- Copy defaults directory -->
+ <copy todir="${build.dir}/components">
+ <fileset dir="components">
+ <include name="**/*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy defaults directory -->
+ <copy todir="${build.dir}/defaults">
+ <fileset dir="defaults">
+ <include name="**/*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy chrome directory -->
+ <copy todir="${build.dir}/chrome">
+ <fileset dir="chrome">
+ <include name="**/*.js"/>
+ <include name="**/*.xul"/>
+ <include name="**/*.properties"/>
+ <include name="**/*.css"/>
+ <include name="**/*.html"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.png"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.ico"/>
+ <include name="**/*.manifest"/>
+ <include name="**/*.txt"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy defaults directory -->
+ <copy todir="${build.dir}/icons">
+ <fileset dir="icons">
+ <include name="**/*.ico"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy defaults directory -->
+ <copy todir="${build.dir}/modules">
+ <fileset dir="modules">
+ <include name="**/*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy extension installation files and licence.txt -->
+ <copy file="chrome.manifest" todir="${build.dir}"/>
+ <copy file="install.rdf" todir="${build.dir}"/>
+ <copy file="license.txt" todir="${build.dir}"/>
+ <copy file="update.rdf" todir="${build.dir}"/>
+
+ <!-- Update release version from ant.properties file -->
+ <replace file="${build.dir}/install.rdf" propertyFile="ant.properties">
+ <replacefilter token="@VERSION@" property="VERSION"/>
+ <replacefilter token="@RELEASE@" property="RELEASE"/>
+ </replace>
+
+ <!-- Create final tracingConsole.xpi file -->
+ <zip destfile="${build.dir}/fbTrace-${VERSION}${RELEASE}.xpi"
+ basedir="${build.dir}" update="true" />
+
+ <!-- Generate update.rdf file -->
+ <replace file="${build.dir}/update.rdf" propertyFile="ant.properties">
+ <replacefilter token="@VERSION@" property="VERSION"/>
+ <replacefilter token="@RELEASE@" property="RELEASE"/>
+ </replace>
+
+ <!-- Final build message -->
+ <echo message="FBTrace version: ${VERSION}${RELEASE}"/>
+
+ <!-- Deploy -->
+ <antcall target="deploy" />
+ </target>
+
+ <!-- Deploy if target available -->
+ <target name="deploy" if="deploy.dir.available">
+
+ <!-- Deploy xpi & update.rdf files -->
+ <copy file="${build.dir}/update.rdf" todir="${deploy-xpi.dir}" overwrite="true"/>
+ <copy file="${build.dir}/fbTrace-${VERSION}${RELEASE}.xpi" todir="${deploy-xpi.dir}" overwrite="true"/>
+
+ <!-- Final deploy message -->
+ <echo message="fbTrace-${VERSION}${RELEASE} deployed to: ${deploy-xpi.dir}"/>
+ </target>
+
+</project>
@@ -0,0 +1,22 @@
+content fbtrace chrome/content/
+content fbtrace-firebug chrome/firebug/content/
+
+overlay chrome://firebug/content/firebugOverlay.xul chrome://fbtrace/content/traceFirebugOverlay.xul
+
+resource fbtrace modules/
+resource fbtrace-firebug chrome/firebug/modules/
+resource fbtrace_rjs chrome/
+
+resource moduleLoader chrome/firebug/modules/
+
+skin fbtrace classic/1.0 chrome/skin/classic/
+skin fbtrace-os classic/1.0 chrome/skin/classic/win/
+skin fbtrace-os classic/1.0 chrome/skin/classic/mac/ os=Darwin
+skin fbtrace-firebug classic/1.0 chrome/firebug/skin/classic/
+
+locale fbtrace en-US chrome/locale/en-US/
+locale fbtrace-firebug en-US chrome/firebug/locale/en-US/
+
+component {FBDD01C3-6D09-494c-B086-C5D56F346658} components/commandLine.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=FBTrace {FBDD01C3-6D09-494c-B086-C5D56F346658}
+category command-line-handler _firebugtracing @mozilla.org/commandlinehandler/general-startup;1?type=FBTrace
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Firebug Trace Console</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/panelbase.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/dom.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/console.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/win/panel.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace/skin/traceConsole.css" type="text/css"/>
+</head>
+<body>
+ <div id="panelNode-traceConsole"/>
+</body>
+</html>
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/panelbase.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/dom.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/console.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/win/panel.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace/skin/traceConsole.css" type="text/css"/>
+</head>
+<body>
+ <div id="traceLogContent"/>
+</body>
+</html>
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/panelbase.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/dom.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/console.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace-firebug/skin/win/panel.css" type="text/css"/>
+ <link rel="stylesheet" href="chrome://fbtrace/skin/traceConsole.css" type="text/css"/>
+</head>
+<body>
+ <div id="traceLogContent"/>
+</body>
+</html>
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ id="FBTraceConsole-blocker"
+ windowtype="FBTraceConsole-blocker:ui"
+ title="Block JavaScript"
+ width="600" height="480"
+ persist="screenX,screenY,width,height">
+
+ <script type="application/x-javascript">
+ function armOnLoad(event)
+ {
+ window.releaser = window.arguments[0];
+ window.dump("------------ "+window.location+" load " + window.releaser.prefDomain + "\n");
+ window.releaser.unblock = function()
+ {
+ window.dump("------------ "+window.location+" unblock ---------------\n");
+ window.dump("------------ "+window.releaser.prefDomain+" ---------------\n");
+ window.close();
+ window.dump("------------ "+window.closed+" tracing console unblock done ---------------\n");
+ }
+ }
+ window.addEventListener('load', armOnLoad, false);
+ </script>
+ <vbox>
+ <browser id="content" flex="2" disablehistory="true" src="" />
+ </vbox>
+</window>
@@ -0,0 +1,167 @@
+/* See license.txt for terms of usage */
+
+define([], function() {
+
+// ********************************************************************************************* //
+// Constants
+
+// ********************************************************************************************* //
+// Explorer Implementation
+
+TraceConsole.FirebugExplorer =
+{
+ dump: function()
+ {
+ var firebugWindow;
+ FBL.iterateBrowserWindows("navigator:browser", function(win)
+ {
+ if (win.Firebug)
+ {
+ firebugWindow = win;
+ return true;
+ }
+ });
+
+ var contentView = FBL.getContentView(firebugWindow);
+ if (!contentView)
+ {
+ FBTrace.sysout("No Browser with Firebug found!");
+ return;
+ }
+
+ var messageInfo = {
+ obj: this.getObjects(contentView.Firebug),
+ type: "firebug-explorer",
+ scope: null,
+ time: (new Date()).getTime()
+ };
+
+ var message = new Firebug.TraceModule.TraceMessage(
+ messageInfo.type, "Firebug Explorer", messageInfo.obj, messageInfo.scope,
+ messageInfo.time);
+
+ Firebug.TraceModule.dump(message, TraceConsole);
+
+ this.cleanUp(contentView.Firebug);
+ },
+
+ getObjects: function(root)
+ {
+ function insert(root, path, value)
+ {
+ var steps = path.split(".");
+ for (var p in steps)
+ {
+ var label = steps[p];
+ var branch = root[label];
+ if (!branch)
+ branch = root[label] = {};
+ root = branch;
+ }
+ }
+
+ var result = {};
+ var results = [];
+ var iter = new FirebugIterator();
+ iter.iterate(root, "Firebug", function(obj, path)
+ {
+ if (obj.hasOwnProperty("__explored"))
+ return false;
+
+ if (FirebugReps.Arr.isArray(obj))
+ obj.__explored = obj.length;
+ else
+ obj.__explored = true;
+
+ var value = "";
+ try {
+ value = (obj.toString ? obj.toString() : "")
+ } catch (e) {}
+
+ insert(result, path, value);
+
+ //results.push(path);
+ return true;
+ });
+
+ return result;
+ },
+
+ cleanUp: function(root)
+ {
+ var iter = new FirebugIterator();
+ iter.iterate(root, "Firebug", function(obj, path)
+ {
+ if (!obj.hasOwnProperty("__explored"))
+ return false;
+
+ delete obj.__explored;
+
+ return true;
+ });
+ }
+}
+
+// ********************************************************************************************* //
+// Object Iterator
+
+/**
+ * Recursively iterates all children objects.
+ */
+function FirebugIterator()
+{
+}
+
+FirebugIterator.prototype =
+/** @lends FirebugIterator */
+{
+ /**
+ * Recursive iteration over all children of given object
+ * @param {Object} obj The object to iterate
+ * @param {String} path helper path for logging.
+ * @param {Function} callback Callback function executed for each object.
+ */
+ iterate: function(obj, path, callback)
+ {
+ if (!callback.apply(this, [obj, path]))
+ return;
+
+ if (typeof(obj) !== "object")
+ return;
+
+ var names = Object.keys(obj);
+ for (var i=0; i<names.length; i++)
+ {
+ var name = names[i];
+ var child = obj[name];
+
+ // Ignore built-in objects
+ if (FBL.isDOMMember(obj, name) || FBL.isDOMConstant(obj, name))
+ continue;
+
+ if (name == "__explored" || name == "prototype" ||
+ name == "__proto__" || name == "window" || name == "tabBrowser")
+ continue;
+
+ if (typeof(child) == "function")
+ continue;
+
+ try
+ {
+ this.iterate(child, path + "." + name, callback);
+ }
+ catch (exc)
+ {
+ FBTrace.sysout("iterate EXCEPTION " + path + "." + name, exc);
+ break;
+ }
+ }
+ },
+};
+
+// ********************************************************************************************* //
+
+return TraceConsole.FirebugExplorer;
+
+// ********************************************************************************************* //
+});
Oops, something went wrong.

0 comments on commit 8577541

Please sign in to comment.