Skip to content

Conversation

@realchrislovett
Copy link
Contributor

It looks like with the last update, the PWA install button in Chrome-based browsers no longer appears. Adding the start_url line resolves this and restores that functionality. This change also retains the PWA functionality we expect on mobile devices, as tested on my iPhone.

@realchrislovett
Copy link
Contributor Author

For context, this documentation states start_url is required for PWA functionality on Chromium-based browsers, along with:

name or short_name
icons must contain a 192px and a 512px icon
display and/or display_override
prefer_related_applications must be false or not present

@schlagmichdoch
Copy link
Owner

Too bad, sorry for the inconvenience! Thanks for pointing it out.
I will release a new patch version tomorrow!

We should use "start_url": "./" though as discussed over here: #329

Copy link
Owner

@schlagmichdoch schlagmichdoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "./" instead of "/"

@realchrislovett
Copy link
Contributor Author

realchrislovett commented Feb 18, 2025

I went with / after reading the Best Practices section of the documentation:

If your app's main page is at the root of your site, you can set the start_url to /.

I see in the issue that caused a problem with using sublocations and PWA installs. I've tested this and ./ indeed solves that problem as well as allows Chromium browsers to show the PWA button. I'll fix my pull request.

@schlagmichdoch
Copy link
Owner

If your app's main page is at the root of your site, you can set the start_url to /.

That’s the case for https://pairdrop.net/ but might not be the case if the instance is hosted on a subpath like https://example.com/pairdrop/
In this case a start_url of / would lead the PWA to open https://example.com/ which would be wrong.

./ would lead to the path under which the manifest.json is hosted, which is what we want. This is actually also what the documentation says to be the default.

If start_url is unspecified or the value is invalid […], the URL of the page that links to the manifest is used.

Apparently, this leads to the breaking of the installation request, though. They should make that clearer I think.

@schlagmichdoch schlagmichdoch merged commit 341fa7f into schlagmichdoch:master Feb 19, 2025
2 checks passed
schlagmichdoch added a commit that referenced this pull request Feb 19, 2025
## Fixes
- Fix PWA install button on chromium based browsers (#383) (Thanks @realchrislovett)
- Fix wrong file extension on chromium based browsers if mime type is not set (#355)

## Languages
- Translations updates from Hosted Weblate (Japanese)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants