[Pkg-mozext-commits] [firebug] 05/16: Issue 7640 (Firebug can't be opened anymore on Firefox 34) https://code.google.com/p/fbug/issues/detail?id=7640

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 18:10:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 674df98b8be95404726288c7e173a43a611fdc1d
Author: Sebastian Zartner <sebastianzartner at gmail.com>
Date:   Mon Aug 25 00:41:10 2014 +0200

    Issue 7640 (Firebug can't be opened anymore on Firefox 34)
    https://code.google.com/p/fbug/issues/detail?id=7640
---
 extension/content/firebug/firebug.js               | 12 +++++++++
 .../content/firebug/firefox/browserOverlayLib.js   | 30 +++++++++++++++-------
 2 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/extension/content/firebug/firebug.js b/extension/content/firebug/firebug.js
index ed4d101..66596fb 100644
--- a/extension/content/firebug/firebug.js
+++ b/extension/content/firebug/firebug.js
@@ -304,6 +304,18 @@ window.Firebug =
     {
         window.removeEventListener("unload", shutdownFirebug, false);
 
+        // Save the UI attributes, so they can be persisted across browser sessions
+        try {
+            var xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
+            var attributes = ["width", "height"];
+            attributes.forEach((attr) => {
+                var value = Firebug.browserOverlay.doc.getElementById("fbMainFrame").
+                    getAttribute(attr);
+                xulStore.setValue(Firebug.browserOverlay.doc, "fbMainFrame", attr, value);
+            });
+        }
+        catch (e) {}
+
         Events.dispatch(modules, "disable", [Firebug.chrome]);
     },
 
diff --git a/extension/content/firebug/firefox/browserOverlayLib.js b/extension/content/firebug/firefox/browserOverlayLib.js
index d8ffd98..ab7b1e9 100644
--- a/extension/content/firebug/firefox/browserOverlayLib.js
+++ b/extension/content/firebug/firefox/browserOverlayLib.js
@@ -269,18 +269,30 @@ function updatePersistedValues(doc, options)
 {
     var persist = options.persist.split(",");
     var id = options.id;
-    var RDF = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
-    var store = doc.defaultView.PlacesUIUtils.localStore; //this.RDF.GetDataSource("rdf:local-store");
-    var root = RDF.GetResource("chrome://browser/content/browser.xul#" + id);
+    try
+    {
+        var xulStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
 
-    var getPersist = function getPersist(aProperty)
+        var getPersist = function getPersist(attr)
+        {
+            return xulStore.getValue(doc, id, attr);
+        }
+    }
+    catch(e)
     {
-        var property = RDF.GetResource(aProperty);
-        var target = store.GetTarget(root, property, true);
+        var RDF = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
+        var store = doc.defaultView.PlacesUIUtils.localStore; //this.RDF.GetDataSource("rdf:local-store");
+        var root = RDF.GetResource("chrome://browser/content/browser.xul#" + id);
 
-        if (target instanceof Ci.nsIRDFLiteral)
-            return target.Value;
-    };
+        var getPersist = function getPersist(aProperty)
+        {
+            var property = RDF.GetResource(aProperty);
+            var target = store.GetTarget(root, property, true);
+
+            if (target instanceof Ci.nsIRDFLiteral)
+                return target.Value;
+        };
+    }
 
     for (var i=0; i<persist.length; i++)
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list