From fbb1c09f6f9cf5f52a2a67aba40831e118a133b5 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sat, 15 Apr 2023 15:17:14 +0800 Subject: [PATCH] opt: remove js interval when not detect parentIframe --- scripts/iframe-defer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/iframe-defer.js b/scripts/iframe-defer.js index 8bd59800..ebaaaea9 100644 --- a/scripts/iframe-defer.js +++ b/scripts/iframe-defer.js @@ -17,4 +17,7 @@ var interval = setInterval(function () { console.log("iframe set height to " + height); parentIFrame.size(height); } + else { + clearInterval(interval); + } }, 500);