fix: add pwa=true query param when sharing files (#2004)

This commit is contained in:
Nolan Lawson 2021-03-18 07:00:48 -07:00 committed by GitHub
parent fd321720f2
commit 3bf744d2c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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