2022-09-05 12:17:00 +00:00
|
|
|
var start_time=new Date().getTime();
|
|
|
|
|
|
|
|
var interval = setInterval(function () {
|
|
|
|
var end_time=new Date().getTime();
|
|
|
|
//for 10 seconds.
|
|
|
|
if(end_time-start_time>=10000){
|
|
|
|
clearInterval(interval);
|
|
|
|
}
|
|
|
|
|
2022-09-04 11:03:27 +00:00
|
|
|
const body = document.body;
|
|
|
|
const html = document.documentElement;
|
|
|
|
|
|
|
|
const height = Math.max(body.scrollHeight, body.offsetHeight,
|
|
|
|
html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
|
|
|
|
|
|
if ('parentIFrame' in window) {
|
|
|
|
console.log("iframe set height to " + height);
|
|
|
|
parentIFrame.size(height);
|
|
|
|
}
|
2023-04-15 07:17:14 +00:00
|
|
|
else {
|
|
|
|
clearInterval(interval);
|
|
|
|
}
|
2022-09-05 12:17:00 +00:00
|
|
|
}, 500);
|