Last modified: 2014-06-17 17:02:43 UTC
When the editwarning feature is enabled, the warning dialog does not appear in IE8. It works fine in Firefox 8.0 and Chrome 16.0.912.63 m. This is on Windows Server 2008 with MediaWiki 1.18.0. (It's also broken in 1.17.1.) I am guessing that your custom "beforeunload" handler is not working correctly in IE8. I tried a custom extension that seems to work fine using this ordinary jQuery code: $(window).bind("beforeunload", function() { if (various conditions) { return 'You will lose any edits you have made.'; } } }); My configuration is: # Vector skin feature configuration require_once( "{$IP}/extensions/Vector/Vector.php" ); $wgVectorUseSimpleSearch = true; $wgDefaultUserOptions['vector-collapsiblenav'] = 1; $wgVectorFeatures['editwarning']['global'] = true; $wgDefaultUserOptions['vector-editwarning'] = 1; $wgDefaultUserOptions['useeditwarning'] = 1; #$wgVectorUseIconWatch = true; # WikiEditor require_once( "$IP/extensions/WikiEditor/WikiEditor.php" ); $wgDefaultUserOptions['usebetatoolbar'] = 0; $wgDefaultUserOptions['usebetatoolbar-cgd'] = 0; $wgDefaultUserOptions['wikieditor-preview'] = 0;
Did you try debugging this using the JS debugger in IE8? https://blogs.msdn.com/b/jscript/archive/2008/03/13/jscript-debugger-in-internet-explorer-8.aspx
Also, seems to work on enwiki, so it would be good to see what is different there.
I tried debugging it in IE's JS debugger, but I couldn't find the relevant JS at all, thanks to ResourceLoader and minifying. (I searched through all the JS files that got loaded and didn't see any WikiEditor code.) Also thanks to IE's fairly obtuse debugger... gimme Firebug! If you have tips how to debug this more easily, I'm happy to try.
Confirmed that it works fine for me on Wikipedia (english). I'll try to isolate the difference.
(In reply to comment #3) > I tried debugging it in IE's JS debugger, but I couldn't find the relevant JS > at all, thanks to ResourceLoader and minifying. Try adding &debug=true to the URL to avoid minification.
The problem is due to one of our extensions. Closing.
Here are the details. The WikiEditor code sets up its beforeunload handler using this style: window.onbeforeunload = function() { context.$textarea.val( context.$textarea.textSelection( 'getContents' ) ); if ( context.fallbackWindowOnBeforeUnload ) { return context.fallbackWindowOnBeforeUnload(); } }; And our extension uses this style: // when the window unloads, abort pending requests $(window) .bind('unload beforeunload', myfunction); Any suggestion how to change this so our handler doesn't prevent your handler from running?
Krinkle, Could you offer some suggestion here for how to specify onUnload handlers?
And if Krinkle doesn't have time to respond, you can also look at [[mw:ResourceLoader/Migration_guide_(users)]]
(In reply to comment #8) > Krinkle, > > Could you offer some suggestion here for how to specify onUnload handlers? There is already a separate bug for this, let me find it.
(In reply to comment #10) > > Could you offer some suggestion here for how to specify onUnload handlers? > There is already a separate bug for this, let me find it. bug 33566