MediaWiki:Common.js: Difference between revisions
Dragon 12dk (talk | contribs) No edit summary |
Dragon 12dk (talk | contribs) No edit summary |
||
| Line 28: | Line 28: | ||
}); | }); | ||
} | } | ||
// Report page height to parent when embedded | |||
( function () { | |||
if ( !window.location.search.includes( 'embed=1' ) ) return; | |||
function sendHeight() { | |||
window.parent.postMessage( { embedHeight: document.body.scrollHeight }, '*' ); | |||
} | |||
mw.hook( 'wikipage.content' ).add( function () { | |||
sendHeight(); | |||
setTimeout( sendHeight, 500 ); | |||
setTimeout( sendHeight, 1500 ); | |||
} ); | |||
} )(); | |||