2 * JavaScript to scroll the page to an id, when a redirect with fragment is viewed.
5 var profile
= $.client
.profile(),
6 fragment
= mw
.config
.get( 'wgRedirectToFragment' );
8 if ( fragment
=== null ) {
13 if ( profile
.layout
=== 'webkit' && profile
.layoutVersion
< 420 ) {
14 // Released Safari w/ WebKit 418.9.1 messes up horribly
15 // Nightlies of 420+ are ok
18 if ( !window
.location
.hash
) {
19 window
.location
.hash
= fragment
;
21 // Mozilla needs to wait until after load, otherwise the window doesn't
22 // scroll. See <https://bugzilla.mozilla.org/show_bug.cgi?id=516293>.
23 // There's no obvious way to detect this programmatically, so we use
24 // version-testing. If Firefox fixes the bug, they'll jump twice, but
25 // better twice than not at all, so make the fix hit future versions as
27 if ( profile
.layout
=== 'gecko' ) {
29 if ( window
.location
.hash
=== fragment
) {
30 window
.location
.hash
= fragment
;
35 }( mediaWiki
, jQuery
) );