Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Hotwire.io to be installable as a Progressive Web App (PWA) #313

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rossta
Copy link

@rossta rossta commented Sep 16, 2024

Background

Prior to this change, in macos Chrome and Edge, the PWA install prompt was not visible in the toolbar.

Screenshot 2024-09-16 at 6 25 39 PM

After this change, the app install prompt is now present.

Screenshot 2024-09-16 at 6 13 14 PM

Details

Key change

  • Removed reference to public/site.manifest from the application layout
  • Updated icon list in manifest.json.erb to point to actual icons

Additional change

  • Renamed app icons to be less-specific to android chrome

Since both site.manifest file and manifest.json were listed as the site manifest in the application layout, I believe browsers were ignoring manifest.json.

The manifest.json.erb file appears to be the desired choice for the site manifest as it is consistent with the style of web manifest used in Rails 7.

Removing the site.manifest file allows browsers to pick up the desired web manifest which contains the necessary properties to make this app installable as a PWA, including name, icons, start_url, and display.

I‘ve also update the names of the relevant icons for the manifest to be less specific to android chrome.

Caveats

I don‘t know the history of site.webmanifest nor am I an Android user but I don‘t believe two manifest files are needed.

PWA = Progressive Web App

Prior to this change, in macos Chrome and Edge, the PWA install prompt
was not visible in the toolbar.

Since both the site.manifest file and the dynamic manifest.json.erb were
listed as the site manifest in the application layout, I believe these
browsers were not consuming the manifest.json.erb file. The
manifest.json.erb file appears to be the desired choice for the site
manifest as it is consistent with the style of web manifest used in
Rails 7.

Removing the site.manifest file allows browsers to pick up the desired
web manifest which contains the necessary properties to make this app
installable as a PWA.

I‘ve also update the names of the relevant icons for the manifest to be
less specific to android chrome.
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.

1 participant