From 3bf744d2c54e828fe964ca39096719b5780c3c40 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 18 Mar 2021 07:00:48 -0700 Subject: [PATCH] fix: add pwa=true query param when sharing files (#2004) --- src/service-worker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/service-worker.js b/src/service-worker.js index a98e189c..6fb5c8c2 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -115,7 +115,10 @@ self.addEventListener('fetch', event => { const file = formData.get('file') await setWebShareData({ title, text, url, file }) await closeKeyValIDBConnection() // don't need to keep the IDB connection open - return Response.redirect('/', 303) // 303 recommended by https://web.dev/web-share-target/ + return Response.redirect( + '/?pwa=true', // same as start_url in manifest.json. This can only be invoked from PWAs + 303 // 303 recommended by https://web.dev/web-share-target/ + ) } // always serve webpack-generated resources and