mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
opt:iframe set height logic restricted to most 10 seconds
This commit is contained in:
parent
9333af47e0
commit
6aedd80ec0
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue