]> _ Git - fluidbook-html5.git/commitdiff
wip #4700 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Sep 2021 17:01:10 +0000 (19:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Sep 2021 17:01:10 +0000 (19:01 +0200)
js/libs/fluidbook/workers/stats.js

index 5931eb29bba7f83abba51f3073a5e60078753541..9d7f3a6a5acddc09c38b805a6607728ad60c5599 100644 (file)
@@ -1,6 +1,8 @@
 importScripts('../../stand/axios.min.js', '../../polyfills/promise.min.js');
 
 onmessage = function (e) {
+    var time = new Date().getTime();
+    e.data.offset = Math.round((time - e.data.time) / 1000);
     var url = 'https://stats.fluidbook.com/stats2.php?' + Object.keys(e.data).reduce(function (a, k) {
         a.push(k + '=' + encodeURIComponent(e.data[k]));
         return a