Skip to content

Commit

Permalink
Issue 6039: Firebug doesn't get closed when popup window is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Nov 14, 2012
1 parent 03b6d81 commit d91b072
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 10 additions & 1 deletion extension/content/firebug/chrome/tabWatcher.js
Expand Up @@ -99,7 +99,16 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
var tabBrowser = Firefox.getElementById("content");
if (tabBrowser)
{
tabBrowser.removeProgressListener(TabProgressListener);
try
{
// Exception thrown: tabBrowser.removeProgressListener is not a function
// when Firebug is in detached state and the origin browser window is closed.
tabBrowser.removeProgressListener(TabProgressListener);
}
catch (e)
{
FBTrace.sysout("tabWatcher.destroy; EXCEPTION " + e, e);
}

var browsers = Firefox.getBrowsers();
for (var i = 0; i < browsers.length; ++i)
Expand Down
11 changes: 7 additions & 4 deletions extension/content/firebug/firefox/firebug.xul
Expand Up @@ -10,7 +10,6 @@
persist="screenX,screenY,width,height,sizemode"
onload="importFirebug()" onunload="" onclose="return exportFirebug();">


<vbox flex="2" id="fbMainFrame" collapsed="false">
<browser id="fbMainContainer" flex="2" src="" disablehistory="true" />
</vbox>
Expand All @@ -23,6 +22,8 @@
<key oncommand="doFirefoxCommand('Browser:ReloadSkipCache')" key='r' modifiers='accel,shift'/>
</keyset>

<script type="application/x-javascript" src="chrome://firebug/content/trace.js"/>

<script type="application/x-javascript">
doFirefoxCommand = function(id)
{
Expand All @@ -31,8 +32,9 @@

importFirebug = function()
{
var Firebug = opener.Firebug, fbc = Firebug.chrome;
FBTrace.sysout("firebug.xul; importFirebug");

var Firebug = opener.Firebug, fbc = Firebug.chrome;
if (fbc.inDetachedScope)
{
exportFirebug = null;
Expand All @@ -51,8 +53,7 @@

fbc.originalBrowser.contentWindow.onunload = function()
{
fbc.shutdown();
fbc.window.top.close();
window.close();
}

fbc.onDetach();
Expand All @@ -61,6 +62,8 @@

exportFirebug = function()
{
FBTrace.sysout("firebug.xul; exportFirebug");

exportFirebug = null;
var Firebug = opener.Firebug, fbc = Firebug.chrome;

Expand Down

0 comments on commit d91b072

Please sign in to comment.