diff --git a/index.html b/index.html
index b4ca78d..eb68aac 100644
--- a/index.html
+++ b/index.html
@@ -9,14 +9,15 @@
+
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 0000000..efef2c4
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,26 @@
+{
+ "name": "在线图片加水印",
+ "short_name": "图片加水印",
+ "theme_color": "#f85758",
+ "background_color": "#f85758",
+ "display": "fullscreen",
+ "scope": "/",
+ "start_url": "/",
+ "icons": [
+ {
+ "src": "logo72x72.png",
+ "type": "image/png",
+ "sizes": "72x72"
+ },
+ {
+ "src": "logo96x96.png",
+ "type": "image/png",
+ "sizes": "96x96"
+ },
+ {
+ "src": "logo144x144.png",
+ "type": "image/png",
+ "sizes": "144x144"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/serviceWorker.js b/serviceWorker.js
new file mode 100644
index 0000000..804916c
--- /dev/null
+++ b/serviceWorker.js
@@ -0,0 +1,22 @@
+const cacheName = "watermark"; // cache名, 在控制台Application的CaChe下可以看到
+
+// eslint-disable-next-line no-restricted-globals
+self.addEventListener("install", e => {
+ e.waitUntil(
+ caches.open(cacheName).then(cache => {
+ return cache.addAll(["/", "/index.html", "/manifest.json"]);
+ }),
+ );
+});
+
+// eslint-disable-next-line no-restricted-globals
+self.addEventListener("fetch", event => {
+ event.respondWith(
+ caches
+ .open(cacheName)
+ .then(cache => cache.match(event.request, { ignoreSearch: true }))
+ .then(response => {
+ return response || fetch(event.request);
+ }),
+ );
+});
\ No newline at end of file