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
( 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;
( 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;