opt:iframe set height logic restricted to most 10 seconds

This commit is contained in:
Xiao YiFang 2022-09-05 20:17:00 +08:00
parent 9333af47e0
commit 6aedd80ec0

View file

@ -1,5 +1,12 @@
setInterval(function () { var start_time=new Date().getTime();
//in some cases ,the website in iframe will load result after document has been loaded. the height will continue to change.
var interval = setInterval(function () {
var end_time=new Date().getTime();
//for 10 seconds.
if(end_time-start_time>=10000){
clearInterval(interval);
}
const body = document.body; const body = document.body;
const html = document.documentElement; const html = document.documentElement;