Download src/scripts/iframe-defer.js from dlxjj/goldendict-ng: direct link, hf CLI and curl.
- Browser
- Download file 613 Bytes
-
https://huggingface.co/datasets/dlxjj/goldendict-ng/resolve/main/src/scripts/iframe-defer.js
- Command line
-
hf download hf://datasets/dlxjj/goldendict-ng/src/scripts/iframe-defer.js
-
curl -L -o iframe-defer.js https://huggingface.co/datasets/dlxjj/goldendict-ng/resolve/main/src/scripts/iframe-defer.js
613 Bytes
| 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); | |
| } | |
| 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); | |
| } | |
| else { | |
| clearInterval(interval); | |
| } | |
| }, 500); | |