mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 16:54:08 +00:00
13 lines
500 B
JavaScript
13 lines
500 B
JavaScript
|
setInterval(function () {
|
||
|
//in some cases ,the website in iframe will load result after document has been loaded. the height will continue to change.
|
||
|
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);
|
||
|
}
|
||
|
}, 500);
|