You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
364 B
16 lines
364 B
'use strict';
|
|
|
|
setupResizeListener();
|
|
|
|
///
|
|
|
|
function setupResizeListener() {
|
|
const RESIZE_CODE = 'resize:';
|
|
|
|
const resizeObserver = new ResizeObserver(entries => {
|
|
const height = document.querySelector('body > main').scrollHeight;
|
|
window.parent.postMessage(RESIZE_CODE + JSON.stringify({height}), '*');
|
|
})
|
|
|
|
resizeObserver.observe(document.body);
|
|
}
|
|
|