Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #57 from rsturgell/master

Fix requestAnimationFrame interception
  • Loading branch information...
commit a33cf20f6c671eef68d95c92d4b170cef4014a33 2 parents 24a380f + 19be9f7
@benvanik benvanik authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 core/host/CaptureContext.js
View
11 core/host/CaptureContext.js
@@ -388,15 +388,18 @@
(function(name) {
var originalFn = window[name];
var lastFrameTime = (new Date());
- window[name] = function(code, element) {
+ window[name] = function(callback, element) {
var time = (new Date());
var delta = (time - lastFrameTime);
- var wrappedCode = wrapCode(code);
if (delta > timerHijacking.value) {
lastFrameTime = time;
- return originalFn.call(window, wrappedCode, element);
+ var wrappedCallback = function() {
+ callback();
+ host.frameTerminator.fire();
+ };
+ return originalFn.call(window, wrappedCallback, element);
} else {
- window.setTimeout(code, delta);
+ window.setTimeout(callback, delta);
}
};
})(name);
Please sign in to comment.
Something went wrong with that request. Please try again.