Permalink
Browse files

[1.10] Bootstrapped Firebug, merge from 1.10rl

  • Loading branch information...
1 parent b19e3ce commit 443c860db6ffd4e163c840e6eec1434b6470b934 @janodvarko janodvarko committed Jan 25, 2012
Showing with 1,991 additions and 1,205 deletions.
  1. +128 −0 extension/bootstrap.js
  2. +11 −11 extension/chrome.manifest
  3. +1 −1 extension/content/firebug/accessible/a11y.js
  4. +0 −33 extension/content/firebug/browserOverlay.xul
  5. +12 −32 extension/content/firebug/chrome/chrome.js
  6. +0 −3 extension/content/firebug/firebug.js
  7. +1 −1 extension/content/firebug/firebugOverlay.xul
  8. +63 −2 extension/content/firebug/firefox/{start-button/startButton.css → browser.css}
  9. +0 −96 extension/content/firebug/firefox/browserMenuOverlay.xul
  10. +960 −0 extension/content/firebug/firefox/browserOverlay.js
  11. +0 −29 extension/content/firebug/firefox/browserOverlayWithFrame.xul
  12. +4 −42 extension/content/firebug/firefox/firebugMenu.js
  13. +0 −127 extension/content/firebug/firefox/firebugMenuOverlay.xul
  14. +0 −7 extension/content/firebug/firefox/start-button/customizeToolbarOverlay.xul
  15. +1 −177 extension/content/firebug/firefox/start-button/startButtonOverlay.js
  16. +0 −95 extension/content/firebug/firefox/start-button/startButtonOverlay.xul
  17. +5 −262 extension/content/firebug/lib/locale.js
  18. +3 −20 extension/content/firebug/lib/options.js
  19. +0 −7 extension/content/firebug/moduleConfig.js
  20. +0 −158 extension/defaults/preferences/firebug.js
  21. +0 −68 extension/defaults/preferences/tracingConsole.js
  22. BIN extension/icon64.png
  23. +3 −2 extension/install.rdf
  24. +3 −2 extension/install.rdf.tpl.xml
  25. +12 −0 extension/modules/fbtrace.js
  26. +37 −23 extension/modules/firebug-service.js
  27. +486 −0 extension/modules/loader.js
  28. +259 −0 extension/modules/locale.js
  29. +1 −1 extension/skin/classic/firebug.css
  30. +0 −5 extension/skin/classic/win/firebug.css
  31. +1 −1 extension/update.rdf.tpl.xml
View
@@ -0,0 +1,128 @@
+/* See license.txt for terms of usage */
+
+// ********************************************************************************************* //
+// Constants
+
+var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+// List of firebug modules that must be loaded at startup and unloaded on shutdown.
+// !important every new module loaded with Cu.import must be added here
+var FIREBUG_MODULES = [
+ "resource://firebug/debuggerHalter.js",
+ "resource://firebug/fbtrace.js",
+ "resource://firebug/firebug-http-observer.js",
+ "resource://firebug/firebug-service.js",
+ "resource://firebug/firebug-trace-service.js",
+ "resource://firebug/loader.js",
+ "resource://firebug/locale.js",
+ "resource://firebug/moduleLoader.js",
+ "resource://firebug/observer-service.js",
+ "resource://firebug/require-debug.js",
+ "resource://firebug/require.js",
+ "resource://firebug/storageService.js"
+];
+
+Cu.import("resource://gre/modules/Services.jsm");
+
+// ********************************************************************************************* //
+// Bootstrap API
+
+function install(params, reason)
+{
+}
+
+function uninstall(params, reason)
+{
+}
+
+function startup(params, reason)
+{
+ // Register the resource:// mappings
+ var res = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
+ var resourceURI = Services.io.newURI(__SCRIPT_URI_SPEC__ + "/../modules/", null, null);
+ res.setSubstitution("firebug", resourceURI);
+ res.setSubstitution("moduleloader", resourceURI);
+
+ // Add our chrome registration. not needed for 10+
+ Components.manager.addBootstrappedManifestLocation(params.installPath);
+
+ // Load the overlay manager
+ Cu.import("resource://firebug/loader.js");
+
+ // register default values
+ FirebugLoader.registerDefaultPrefs();
+
+ //register extensions
+ FirebugLoader.startup();
+
+ // Load Firebug into all existing browser windows.
+ var enumerator = Services.wm.getEnumerator("navigator:browser");
+ while (enumerator.hasMoreElements())
+ FirebugLoader.loadIntoWindow(enumerator.getNext());
+
+ // Listen for new windows, Firebug must be loaded into them too.
+ Services.wm.addListener(WindowListener);
+}
+
+function shutdown(params, reason)
+{
+ // Don't need to clean anything up if the application is shutting down
+ if (reason == APP_SHUTDOWN)
+ return;
+
+ // Remove "new window" listener.
+ Services.wm.removeListener(WindowListener);
+
+ // remove from all windows
+ try
+ {
+ FirebugLoader.shutdown()
+ }
+ catch(e)
+ {
+ Cu.reportError(e)
+ }
+
+ // Shutdown Firebug's JSD debugger service.
+ var fbs = Cu.import("resource://firebug/firebug-service.js", {}).fbs
+ fbs.disableDebugger();
+ fbs.shutdown();
+
+ // remove default preferences
+ FirebugLoader.clearDefaultPrefs();
+
+ // Unload all Firebug modules added with Cu.import
+ FIREBUG_MODULES.forEach(Cu.unload, Cu);
+
+ // Remove our chrome registration. not needed for 10+
+ Components.manager.removeBootstrappedManifestLocation(params.installPath);
+
+ // Clear our resource registration
+ var res = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
+ res.setSubstitution("firebug", null);
+ res.setSubstitution("moduleloader", null);
+}
+
+// ********************************************************************************************* //
+// Window Listener
+
+var WindowListener =
+{
+ onOpenWindow: function(win)
+ {
+ win = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow).window;
+
+ // Wait for the window to finish loading
+ win.addEventListener("load", function onLoad()
+ {
+ win.removeEventListener("load", onLoad, false);
+ if (win.location.href == "chrome://browser/content/browser.xul")
+ FirebugLoader.loadIntoWindow(win)
+ }, false);
+ },
+
+ onCloseWindow: function(win) {},
+ onWindowTitleChange: function(win, aTitle) {}
+}
+
+// ********************************************************************************************* //
View
@@ -2,10 +2,10 @@ content firebug content/firebug/
content firebug content/firebug/ contentaccessible=yes
# Maps resource://firebug/* to files in modules/*
-resource firebug modules/
+# resource firebug modules/
# Maps resource://moduleloader/* to files in modules/*
-resource moduleloader modules/
+# resource moduleloader modules/
skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/
@@ -47,18 +47,18 @@ locale firebug zh-CN locale/zh-CN/
locale firebug zh-TW locale/zh-TW/
#overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
-overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
-overlay chrome://browser/content/browser.xul chrome://firebug/content/editor/external/editorsBrowserOverlay.xul
+#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
+#overlay chrome://browser/content/browser.xul chrome://firebug/content/editor/external/editorsBrowserOverlay.xul
-overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
-overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul
+#overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
+#overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul
# Sea Monkey
#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/browserOverlay.xul
-overlay chrome://navigator/content/navigator.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
+#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
# Support for Mac
-override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
-override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
-override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
-override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
+override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
+override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
+override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
+override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
@@ -125,7 +125,7 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
var tmpElem;
//add class used by all a11y related css styles (e.g. :focus and -moz-user-focus styles)
Css.setClass(chrome.$("fbContentBox"), "useA11y");
- Css.setClass(chrome.$("fbStatusBar"), "useA11y");
+ //Css.setClass(chrome.$("fbStatusBar"), "useA11y");
tmpElem = chrome.$("fbStatusPrefix");
if (tmpElem) tmpElem.setAttribute("value", Locale.$STR("a11y.labels.firebug status"));
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<!-- See license.txt for terms of usage -->
-
-<?xul-overlay href="chrome://firebug/content/firebugOverlay.xul"?>
-<?xul-overlay href="chrome://firebug/content/firefox/start-button/startButtonOverlay.xul"?>
-<?xul-overlay href="chrome://firebug/content/firefox/browserMenuOverlay.xul"?>
-
-<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://firebug/content/trace.js"/>
- <script type="application/x-javascript" src="chrome://firebug/content/legacy.js"/>
- <script type="application/x-javascript" src="chrome://firebug/content/moduleConfig.js"/>
- <script type="application/x-javascript" src="chrome://firebug/content/firefox/panelBarWaiter.js"/>
- <script type="application/x-javascript" src="resource://firebug/require.js"/>
- <script type="application/x-javascript" src="resource://firebug/require-debug.js"/>
- <script type="application/x-javascript" src="chrome://firebug/content/main.js"/>
-
- <stringbundleset id="stringbundleset"/>
- <commandset id="baseMenuCommandSet"/>
- <keyset id="baseMenuKeyset"/>
- <keyset id="mainKeyset"/>
- <broadcasterset id="mainBroadcasterSet"/>
- <popupset id="mainPopupSet"/>
-
- <!-- Firebug panel -->
- <vbox id="appcontent">
- <splitter id="fbContentSplitter" collapsed="true"/>
- <vbox id="fbMainFrame" persist="height" collapsed="true">
- <vbox id="fbContentBox" flex="2" />
- </vbox>
- </vbox>
-
-</overlay>
@@ -224,6 +224,9 @@ var FirebugChrome =
if (FBTrace.DBG_INITIALIZE)
FBTrace.sysout("chrome.initializeUI; Custom stylesheet appended " +
Firebug.stylesheets.length, Firebug.stylesheets);
+
+ // Fire event for window event listeners.
+ Firebug.sendLoadEvent();
}
catch (exc)
{
@@ -1027,23 +1030,24 @@ var FirebugChrome =
pos && this.syncPositionPref(pos);
- var vertical = pos == 'top' || pos == 'bottom';
- var after = pos == 'bottom' || pos == 'right';
+ var vertical = pos == "top" || pos == "bottom";
+ var after = pos == "bottom" || pos == "right";
var document = window.top.document;
- var splitter = Firefox.getElementById('fbContentSplitter');
var container = document.getElementById(vertical ? "appcontent" : "browser");
+
+ var splitter = Firefox.getElementById("fbContentSplitter");
splitter.setAttribute("orient", vertical ? "vertical" : "horizontal");
splitter.setAttribute("dir", after ? "" : "reverse");
- container.insertBefore(splitter, after ? null: container.firstChild);
+ container.insertBefore(splitter, after ? null : container.firstChild);
- var frame = document.getElementById('fbMainFrame');
+ var frame = document.getElementById("fbMainFrame");
var newFrame = frame.cloneNode(true);
- var newBrowser = newFrame.querySelector('#fbMainContainer');
- var oldBrowser = frame.querySelector('#fbMainContainer');
+ var newBrowser = newFrame.querySelector("#fbMainContainer");
+ var oldBrowser = frame.querySelector("#fbMainContainer");
- newBrowser.removeAttribute('src');
+ newBrowser.removeAttribute("src");
container.insertBefore(newFrame, after ? null: container.firstChild);
this.swapBrowsers(oldBrowser, newBrowser);
@@ -1067,30 +1071,6 @@ var FirebugChrome =
return Firebug.framePosition = pos;
},
- onPositionPopupShowing: function(popup)
- {
- Dom.eraseNode(popup);
-
- var items = [];
-
- for each(var pos in ["detached", "top", "bottom", "left", "right"])
- {
- items.push({
- label: Locale.$STR("position." + pos),
- type: "radio",
- command: Obj.bindFixed(this.setPosition, this, pos),
- checked: Firebug.framePosition == pos
- });
- }
-
- items.splice(1, 0, "-");
-
- items[0].key = "key_detachFirebug";
-
- for each(var i in items)
- Menu.createMenuItem(popup, i);
- },
-
swapBrowsers: function(oldBrowser, newBrowser)
{
var oldDoc = oldBrowser.contentDocument
@@ -173,9 +173,6 @@ window.Firebug =
Events.dispatch(modules, "initialize", []);
- // Fire event for window event listeners.
- this.sendLoadEvent();
-
// This is the final of Firebug initialization.
FBTrace.timeEnd("INITIALIZATION_TIME");
},
@@ -111,7 +111,7 @@
<!-- Open In New Window & Minimize & Close -->
<hbox id="fbWindowButtons" role="toolbar" class="innerToolbar"
aria-label="firebug window" context="_child">
- <menupopup onpopupshowing="Firebug.chrome.onPositionPopupShowing(this)"/>
+ <menupopup onpopupshowing="Firebug.GlobalUI.onPositionPopupShowing(this)"/>
<toolbarbutton id="fbMinimizeButton"
class="toolbarbutton-iconic fbInternational"
tooltiptext="Minimize Firebug" command="cmd_minimizeFirebug"/>
@@ -15,7 +15,7 @@
}
#firebug-button[firebugActive="true"] .toolbarbutton-icon {
- list-style-image: url(chrome://firebug/skin/firebug16.png);
+ list-style-image: url(chrome://firebug/skin/firebug16.png)!important;
}
/* Error badge (displays an error counter). The badge is only visible if error count
@@ -60,6 +60,14 @@
visibility: visible;
}
+/* old statusbar item look when on addonbar*/
+#addon-bar #firebug-button dropmarker {
+ display: none;
+}
+#addon-bar #firebug-button .fb-toolbarbutton{
+ padding: 0 3px!important;
+}
+
/* Slightly different positions of the badge for individual toolbars */
#nav-bar #firebug-button .badge {
margin: 3px -10px 0 -8px;
@@ -105,4 +113,57 @@
#fbStatusIcon[firebugActive="true"] {
list-style-image: url(chrome://firebug/skin/firebug16.png);
-}
+}
+
+/*************************************************************************************************/
+/* Firebug Menu & Firefox context menu */
+
+#menu_firebug, #appmenu_firebug, #menu_webDeveloper_firebug {
+ list-style-image: url(chrome://firebug/skin/firebug16.png);
+}
+
+#menu_firebugInspect {
+ list-style-image: url(chrome://firebug/skin/Templarian_inspector.png);
+ -moz-image-region: rect(0, 16px, 16px, 0);
+}
+
+#menu_firebugInspect:hover,
+#menu_firebugInspect:active {
+ -moz-image-region: rect(16px, 16px, 32px, 0);
+}
+
+/*************************************************************************************************/
+/* browser.xul & browserOverlayWithFrame */
+
+#fbMainFrame {
+ height: 270px;
+ width: 370px;
+}
+
+/*************************************************************************************************/
+/* Firebug Splitter */
+
+#fbContentSplitter{
+ border-color: threedShadow !important;
+ background-color: #FFFFFF;
+}
+
+#fbContentSplitter[dir=reverse]{
+ -moz-transform: scale(-1, -1);
+}
+
+#fbContentSplitter[orient=vertical] {
+ border-top: 1px solid !important;
+ border-bottom: none;
+ min-height: 5px;
+ max-height: 5px;
+ background-color: -moz-dialog;
+}
+
+#fbContentSplitter[orient=horizontal] {
+ border-right: 1px solid !important;
+ border-left: none;
+ min-width: 5px;
+ max-width: 5px;
+ background-color: -moz-dialog;
+}
Oops, something went wrong.

0 comments on commit 443c860

Please sign in to comment.