-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraxSW.js
70 lines (67 loc) · 2.31 KB
/
traxSW.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2018 Campbell Crowley. All rights reserved.
// Author: Campbell Crowley (web@campbellcrowley.com)
// const URL = 'https://dev.campbellcrowley.com/trax';
// const indexURLs = [
// '', '/', '?hud=1', '/?hud=1', '?video=1', '/?video=1', '?hud=1&video=1',
// '?video=1&hud=1', '/?hud=1&video=1',
// '/?video=1&hud=1', /* , '/live', '/live/', '/live/index.html'*/
// ];
self.addEventListener('install', function(event) {
// if (caches) {
// if (location.hostname.indexOf('dev') == 0) {
// caches.delete('TraX Offline');
// console.warn(
// "DEVELOPMENT PAGE DETECTED. NOT ENABLING OFFLINE MODE AND CLEARING
// CACHE.");
// return;
// }
// event.waitUntil(caches.open('TraX Offline').then(function(cache) {
// return cache.addAll([
// '/version.txt',
// '/styles.css',
// '/dataViewStyles.css',
// '/paneStyles.css',
// '/mapStyles.css',
// '/friendStyles.css',
// '/keepAwake.js',
// 'https://dev.campbellcrowley.com/socket.io.js',
// 'https://dev.campbellcrowley.com/loading.gif',
// '/pagecontroller.js',
// '/viewdatacontroller.js',
// '/paneController.js',
// '/mymapcontroller.js',
// '/lz-string.min.js',
// '/canvascontroller.js',
// '/constants.js',
// '/videocontroller.js',
// '/importexport.js',
// '/xml2json.min.js',
// '/Blob.js',
// '/images/checkeredFlag.png',
// '/images/greenFlag.png',
// '/images/greenLight.png',
// '/images/pencil.png',
// '/images/processing.png',
// '/images/redLight.png',
// '/images/trash.png',
// '/images/yellowLight.png'/*,
// '/live/livecontroller.js',
// '/live/styles.css'*/
// ].concat(indexURLs).map(x => URL + x));
// }));
// } else {
// console.warn("traxSW Caching not supported.");
// }
console.log('traxSW.js Installed!');
});
// self.addEventListener('fetch', function(event) {
// if (event.request.cache === 'only-if-cached' &&
// event.request.mode !== 'same-origin')
// return;
//
// if (caches) {
// event.respondWith(caches.match(event.request).then(function(response) {
// return response || fetch(event.request);
// }));
// }
// });