Skip to content

Commit c711d2a

Browse files
setTimeout doesn't work, use another timeout function
Patch from @ngyikp ngyikp@6b5fa84
1 parent 69d3cdc commit c711d2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extension/src/json-viewer/load-css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ function loadCSS(opts) {
3333
}
3434

3535
if (/loaded/.test(content)) {
36-
clearTimeout(scheduleId);
36+
cancelAnimationFrame(scheduleId);
3737
document.body.removeChild(checkElement);
3838
resolve();
3939

4040
} else {
4141
attempts++;
42-
scheduleId = setTimeout(scheduleCheck, 1);
42+
scheduleId = requestAnimationFrame(scheduleCheck, 1);
4343
}
4444
}
4545

0 commit comments

Comments
 (0)