update the service worker
This commit is contained in:
parent
7ea108a3a1
commit
5fa051466d
1 changed files with 3 additions and 4 deletions
|
@ -52,17 +52,16 @@ function samedomain(url: string | URL) {
|
||||||
return new URL(url).origin === self.origin;
|
return new URL(url).origin === self.origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
const htmlFiles = new Set(["/index", "/login", "/home", "/register", "/oauth2/auth"]);
|
let enabled = "false";
|
||||||
|
let offline = false;
|
||||||
|
|
||||||
|
const htmlFiles = new Set(["/index", "/login", "/home", "/register", "/oauth2/auth", "/reset"]);
|
||||||
function isHtml(url: string): string | void {
|
function isHtml(url: string): string | void {
|
||||||
const path = new URL(url).pathname;
|
const path = new URL(url).pathname;
|
||||||
if (htmlFiles.has(path) || htmlFiles.has(path + ".html")) {
|
if (htmlFiles.has(path) || htmlFiles.has(path + ".html")) {
|
||||||
return path + path.endsWith(".html") ? "" : ".html";
|
return path + path.endsWith(".html") ? "" : ".html";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let enabled = "false";
|
|
||||||
let offline = false;
|
|
||||||
|
|
||||||
function toPath(url: string): string {
|
function toPath(url: string): string {
|
||||||
const Url = new URL(url);
|
const Url = new URL(url);
|
||||||
let html = isHtml(url);
|
let html = isHtml(url);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue