From b5936954f6817733c0b9bd9c4121851a539fc200 Mon Sep 17 00:00:00 2001 From: "ace@google.com" Date: Tue, 14 Apr 2009 19:11:52 +0000 Subject: Update playback extension so that javascript functions return consistent (but not constant) values in an attempt to preserve the functionality but improve compatibility of the extension. Review URL: http://codereview.chromium.org/62165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13688 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/extensions/v8/playback_extension.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'webkit/extensions') diff --git a/webkit/extensions/v8/playback_extension.cc b/webkit/extensions/v8/playback_extension.cc index e850457..42d0525 100644 --- a/webkit/extensions/v8/playback_extension.cc +++ b/webkit/extensions/v8/playback_extension.cc @@ -14,11 +14,15 @@ v8::Extension* PlaybackExtension::Get() { kPlaybackExtensionName, "(function () {" " var orig_date = Date;" + " var x = 0;" + " var time_seed = 1204251968254;" " Math.random = function() {" - " return 0.5;" + " x += .1;" + " return (x % 1);" " };" " Date.__proto__.now = function() {" - " return new orig_date(1204251968254);" + " time_seed += 50;" + " return new orig_date(time_seed);" " };" " Date = function() {" " return Date.now();" -- cgit v1.1