From 42556bb678032805c47f126d6e832242eeb85d5b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Tue, 15 Oct 2019 21:21:40 -0400 Subject: kill pageview timer experiment (#83) --- static/js/pageview_timer.js | 31 ------------------------------- static/js/sw.js | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 static/js/pageview_timer.js (limited to 'static') diff --git a/static/js/pageview_timer.js b/static/js/pageview_timer.js deleted file mode 100644 index 2761396..0000000 --- a/static/js/pageview_timer.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - Hi, - - If you are reading this, you have found this script in the referenced scripts - for pages on this site. I know you're gonna have to take me at my word on this, - but I'm literally using this to collect how much time people spend reading my - webpages. See metrics here: https://christine.website/metrics - - If you have the "do not track" setting enabled in your browser, this code will - be ineffectual. -*/ - -(function() { - let dnt = navigator.doNotTrack; - if (dnt === "1") { - return; - } - - let startTime = new Date(); - - function logTime() { - let stopTime = new Date(); - window.navigator.sendBeacon("/api/pageview-timer", JSON.stringify({ - "path": window.location.pathname, - "start_time": startTime.toISOString(), - "end_time": stopTime.toISOString() - })); - } - - window.addEventListener("pagehide", logTime, false); -})(); diff --git a/static/js/sw.js b/static/js/sw.js index deaa947..62722a6 100755 --- a/static/js/sw.js +++ b/static/js/sw.js @@ -5,7 +5,7 @@ self.addEventListener('install', function(event) { event.waitUntil(preLoad()); }); -const cacheName = "cache-2019-05-21"; +const cacheName = "cache-2019-10-15"; var preLoad = function(){ console.log('[PWA Builder] Install Event processing'); -- cgit v1.2.3