Skip to content

Commit 538abc7

Browse files
authored
Merge pull request #209 from VladimirAlexiev/patch-1
`setTimeout` doesn't work, use another timeout function
2 parents fbb8948 + c711d2a commit 538abc7

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)