From 26bde8cdf1c6320e11e7fc24a5c0926e57893e86 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 30 Jun 2017 13:36:54 -0700 Subject: [PATCH] Move wgBreakFrames client code to mediawiki.page.startup Follows-up f7c324685195, which migrated this from legacy wikibits to the 'mediawiki.page.ready', however it's better suited in 'mediawiki.page.startup' because that one loaded on all pages blindly (used to be hardcoded in OutputPage, now part of 'core' group in Skin::getDefaultModules). mediawiki.page.ready on the other hand is primarily for enhancing the page content, loaded in Skin::getDefaultModules in the 'content' group, which extensions like MobileFrontend may override with an alternate implementation. This means frame breaking is bypassed! Change-Id: Ia7206fac5c4ec6ace87304cfaeef375916b94fcf --- resources/src/mediawiki/page/ready.js | 10 ---------- resources/src/mediawiki/page/startup.js | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/resources/src/mediawiki/page/ready.js b/resources/src/mediawiki/page/ready.js index 1f6c8a69c4..e1476641e2 100644 --- a/resources/src/mediawiki/page/ready.js +++ b/resources/src/mediawiki/page/ready.js @@ -1,14 +1,4 @@ ( function ( mw, $ ) { - // Break out of framesets - if ( mw.config.get( 'wgBreakFrames' ) ) { - // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet) - // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266) - if ( window.top !== window.self ) { - // Un-trap us from framesets - window.top.location.href = location.href; - } - } - mw.hook( 'wikipage.content' ).add( function ( $content ) { var $sortable, $collapsible; diff --git a/resources/src/mediawiki/page/startup.js b/resources/src/mediawiki/page/startup.js index 49cfd8ac3f..7514044538 100644 --- a/resources/src/mediawiki/page/startup.js +++ b/resources/src/mediawiki/page/startup.js @@ -1,4 +1,13 @@ ( function ( mw, $ ) { + // Break out of framesets + if ( mw.config.get( 'wgBreakFrames' ) ) { + // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet) + // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266) + if ( window.top !== window.self ) { + // Un-trap us from framesets + window.top.location.href = location.href; + } + } $( function () { var $diff; -- 2.20.1