Description

Using Mozilla Firefox with Firebug installed and enabled, having the Firebug option "Break on all errors" enabled.

Navigating away from a page causes Firebug to break javascript execution in the "before_unload" handler, when the following line of code is encountered:

try {return confirmleaving();}

Steps to reproduce

  1. Install the Firebug extension for Mozilla Firefox, restart Firefox.
  2. Navigate to http://moinmo.in/

  3. Ensure both "Disable Firebug" and "Disable Firebug for moinmo.in" are both not checked in the Tools > Firebug menu.

  4. Open Firebug from the Firebug menu.
  5. In the Script tab, under Options, ensure "Break on All Errors" is enabled.
  6. Navigate to *any* other page, either by clicking an in page link, typing any address into the address bar, selecting a bookmarked page, etc.

Example

Component selection

Details

All MoinMoin Wiki sites, including This Wiki.

Workaround

Discussion

You should test to see if confirmleaving is a function before attempting to call it:

--- common.js   2008-06-30 12:50:38.000000000 +1000
+++ common_fixed.js     2008-06-30 12:50:23.000000000 +1000
@@ -234,8 +234,10 @@
     // TODO: Better to set this in the editor html, as it does not make
     // sense elsehwere.
     // confirmleaving is available when editing
-    try {return confirmleaving();}
-    catch (e) {}
+    if(typeof(confirmleaving)=="function") {
+        try {return confirmleaving();}
+        catch (e) {}
+    }
 }

 // Initialize after loading the page

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/BeforeUnloadHandlerCausesFirebugToBreakOnError (last edited 2008-06-30 06:53:43 by ThomasWaldmann)