mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2025-09-10 08:27:20 +00:00
Add functional service worker caching towards local first functionality,
fix favicon link issue in ReviewDetails.html Co-authored-by: rheabhutada02 <rheabhutada02@users.noreply.github.com> Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
@@ -40,3 +40,16 @@ function initFormHandler() {
|
||||
window.location.assign("./CreatePage.html");
|
||||
});
|
||||
}
|
||||
|
||||
const registerServiceWorker = async () => {
|
||||
if ("serviceWorker" in navigator) {
|
||||
try {
|
||||
const registration = await navigator.serviceWorker.register("./sw.js", {
|
||||
scope: "./",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Registration failed with ${error}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
registerServiceWorker();
|
Reference in New Issue
Block a user