Last modified: 2014-06-17 17:02:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35497, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33497 - editwarning dialog does not appear in IE8
editwarning dialog does not appear in IE8
Status: RESOLVED WORKSFORME
Product: MediaWiki skins
Classification: Unclassified
Vector (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-03 22:22 UTC by Dan Barrett
Modified: 2014-06-17 17:02 UTC (History)
6 users (show)

See Also:
Web browser: Internet Explorer
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Barrett 2012-01-03 22:22:10 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;
Comment 1 Mark A. Hershberger 2012-01-05 02:50:21 UTC
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
Comment 2 Mark A. Hershberger 2012-01-05 04:29:04 UTC
Also, seems to work on enwiki, so it would  be good to see what is different there.
Comment 3 Dan Barrett 2012-01-05 15:20:07 UTC
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.
Comment 4 Dan Barrett 2012-01-05 15:21:59 UTC
Confirmed that it works fine for me on Wikipedia (english).  I'll try to isolate the difference.
Comment 5 Mark A. Hershberger 2012-01-06 16:51:07 UTC
(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.
Comment 6 Dan Barrett 2012-01-06 17:16:58 UTC
The problem is due to one of our extensions. Closing.
Comment 7 Dan Barrett 2012-01-06 17:44:46 UTC
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?
Comment 8 Mark A. Hershberger 2012-01-09 15:47:01 UTC
Krinkle,

Could you offer some suggestion here for how to specify onUnload handlers?
Comment 9 Mark A. Hershberger 2012-01-09 15:50:07 UTC
And if Krinkle doesn't have time to respond, you can also look at [[mw:ResourceLoader/Migration_guide_(users)]]
Comment 10 Roan Kattouw 2012-01-09 20:10:47 UTC
(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.
Comment 11 Roan Kattouw 2012-01-09 20:11:17 UTC
(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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links