Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5883: Error topWindow.exportFirebug is not a function while Fir…

…ebug is detached
  • Loading branch information...
commit ab31eaa2e62e1d3f5c57d495e81d52a7cb594190 1 parent 9792331
Jan Odvarko authored September 05, 2012

Showing 1 changed file with 24 additions and 10 deletions. Show diff stats Hide diff stats

  1. 34  extension/content/firebug/firebug.js
34  extension/content/firebug/firebug.js
@@ -856,11 +856,11 @@ window.Firebug =
856 856
             // TODO reattach
857 857
 
858 858
             // window is closing in detached mode
859  
-            if (Firebug.chrome.window.top)
  859
+            var parent = this.getFirebugFrameParent();
  860
+            if (parent)
860 861
             {
861  
-                topWindow = Firebug.chrome.window.top;
862  
-                topWindow.exportFirebug();
863  
-                topWindow.close();
  862
+                parent.exportFirebug();
  863
+                parent.close();
864 864
             }
865 865
 
866 866
             Firebug.setPlacement("minimized");
@@ -901,10 +901,9 @@ window.Firebug =
901 901
         //detached -> inbrowser
902 902
         if (!forceOpen && Firebug.isDetached())
903 903
         {
904  
-            // We need firebug.xul here so, don't use 'top' since it references browser.xul
905  
-            var topWin = Firebug.chrome.window.parent;
906  
-            topWin.exportFirebug();
907  
-            topWin.close();
  904
+            var parent = this.getFirebugFrameParent();
  905
+            parent.exportFirebug();
  906
+            parent.close();
908 907
 
909 908
             if (reopenInBrowser)
910 909
             {
@@ -949,7 +948,6 @@ window.Firebug =
949 948
         Firebug.StartButton.resetTooltip();
950 949
     },
951 950
 
952  
-
953 951
     detachBar: function()
954 952
     {
955 953
         if (Firebug.isDetached())  // can be set true attachBrowser
@@ -960,8 +958,8 @@ window.Firebug =
960 958
 
961 959
         if (Firebug.chrome.waitingForDetach)
962 960
             return null;
963  
-        Firebug.chrome.waitingForDetach = true;
964 961
 
  962
+        Firebug.chrome.waitingForDetach = true;
965 963
         Firebug.chrome.toggleOpen(false);  // don't show in browser.xul now
966 964
 
967 965
         if (FBTrace.DBG_ACTIVATION)
@@ -992,6 +990,22 @@ window.Firebug =
992 990
     },
993 991
 
994 992
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  993
+
  994
+    /**
  995
+     * Returns parent of the firebugFrame.xul frame. The actual parent depends on whether
  996
+     * Firebug is attached or detached.
  997
+     *
  998
+     * attached -> browser.xul
  999
+     * detached -> firebug.xul
  1000
+     */
  1001
+    getFirebugFrameParent: function()
  1002
+    {
  1003
+        // We need firebug.xul in case of detached state. So, don't use 'top' since
  1004
+        // it references browser.xul
  1005
+        return Firebug.chrome.window.parent;
  1006
+    },
  1007
+
  1008
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
995 1009
     // deprecated
996 1010
 
997 1011
     resetAllOptions: function(confirm)

0 notes on commit ab31eaa

Please sign in to comment.
Something went wrong with that request. Please try again.