summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-10-08 19:06:46 +0300
committerAndrew Dolgov <[email protected]>2020-10-08 19:06:46 +0300
commit0d73a0b4e6e053c43fde9fca47a5f68bc227c043 (patch)
treeec426483bfff646ee6d20c572b1d4e46a849f308
parent7395c125123da2adce5d55d3b26a5f8812fdac2c (diff)
redirect everything matching offline.html to cached file (fixes offline search)
-rw-r--r--worker.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/worker.js b/worker.js
index 059d196..90f1724 100644
--- a/worker.js
+++ b/worker.js
@@ -112,7 +112,7 @@ this.addEventListener('fetch', function(event) {
return resp;
}).catch(function() {
- if (req.url[req.url.length-1] == "/" || req.url.match("index.php")) {
+ if (req.url[req.url.length-1] == "/" || req.url.match("index.php") || req.url.match("offline.html")) {
return caches.match("offline.html");
} else if (req.url.match("read.html")) {
return caches.match("read.html");