aboutsummaryrefslogtreecommitdiff
path: root/src/library_browser.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_browser.js')
-rw-r--r--src/library_browser.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 59d2945e..5ec02eee 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -782,7 +782,11 @@ mergeInto(LibraryManager.library, {
}
} else {
Browser.mainLoop.scheduler = function() {
- Browser.requestAnimationFrame(Browser.mainLoop.runner);
+ if (typeof window === 'undefined') { // requestAnimationFrame will fail if window is undefined (e.g. in Node.js)
+ setTimeout(Browser.mainLoop.runner, 1000/60);
+ } else {
+ Browser.requestAnimationFrame(Browser.mainLoop.runner);
+ }
}
}
Browser.mainLoop.scheduler();