From: Ori Livneh Date: Sat, 8 Aug 2015 01:25:55 +0000 (-0700) Subject: Override document.writeln to prevent it from blanking pages X-Git-Tag: 1.31.0-rc.0~10484 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=5d9fe1ec34230ed98024b1b432eb3a9cb17d0cd4;p=lhc%2Fweb%2Fwiklou.git Override document.writeln to prevent it from blanking pages Follow-up for Ic9056d7a77. Same rationale. Bug: T108423 Change-Id: I664ba9b0af4355ac83f2e5892e484a3f3aff0428 --- diff --git a/resources/src/mediawiki.legacy/wikibits.js b/resources/src/mediawiki.legacy/wikibits.js index 1f01110955..05954ffcfc 100644 --- a/resources/src/mediawiki.legacy/wikibits.js +++ b/resources/src/mediawiki.legacy/wikibits.js @@ -215,10 +215,12 @@ win.importScript = importScript; win.importStylesheet = importStylesheet; - // Replace document.write with basic html parsing that appends + // Replace document.write/writeln with basic html parsing that appends // to the to avoid blanking pages. Added JavaScript will not run. - mw.log.deprecate( document, 'write', function ( html ) { - $( 'body' ).append( $.parseHTML( html ) ); - }, 'Use jQuery or mw.loader.load instead.' ); + $.each( [ 'write', 'writeln' ], function ( idx, method ) { + mw.log.deprecate( document, method, function ( html ) { + $( 'body' ).append( $.parseHTML( html ) ); + }, 'Use jQuery or mw.loader.load instead.' ); + } ); }( mediaWiki, jQuery ) );