diff --git a/extension/src/json-viewer/load-css.js b/extension/src/json-viewer/load-css.js index 251e9aa..3abce2d 100644 --- a/extension/src/json-viewer/load-css.js +++ b/extension/src/json-viewer/load-css.js @@ -33,13 +33,13 @@ function loadCSS(opts) { } if (/loaded/.test(content)) { - clearTimeout(scheduleId); + cancelAnimationFrame(scheduleId); document.body.removeChild(checkElement); resolve(); } else { attempts++; - scheduleId = setTimeout(scheduleCheck, 1); + scheduleId = requestAnimationFrame(scheduleCheck, 1); } }