From 277d0c732cd2957b997489b2f845efb8493756ff Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Mon, 3 Jan 2022 14:33:20 -0600 Subject: [PATCH] testing tytd-web-share-target --- manifest.webmanifest | 9 +++++++++ share/index.html | 16 ++++++++++++++++ sw.js | 5 +++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 share/index.html diff --git a/manifest.webmanifest b/manifest.webmanifest index efaddf9..53c91d0 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -6,6 +6,15 @@ "background_color": "#ff0000", "description": "Download YouTube Videos", "orientation": "portrait-primary", + "share_target": { + "action": "./share", + "method": "GET", + "params": { + "title": "title", + "text": "text", + "url": "url" + } + }, "icons": [ { "src": "assets/icons/icon-72x72.png", diff --git a/share/index.html b/share/index.html new file mode 100644 index 0000000..8f9bf62 --- /dev/null +++ b/share/index.html @@ -0,0 +1,16 @@ + + + + + + + TYTD + + +

+ + + \ No newline at end of file diff --git a/sw.js b/sw.js index 91f7006..6e97512 100644 --- a/sw.js +++ b/sw.js @@ -11,7 +11,8 @@ var urlsToCache = [ './js/jquery.js', './search.html', './upload.html', - './legacy.html' + './legacy.html', + ]; self.addEventListener('install', function(event) { @@ -26,7 +27,7 @@ self.addEventListener('install', function(event) { }); self.addEventListener('fetch',function(event) { event.respondWith( - + caches.match(event.request) .then(function(response) { // Cache hit - return response