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

Support manifest.json to install as WebApp #1757

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added static/manifest-icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-384x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-icons/icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/mastodon-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/mastodon-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/responses-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/start-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/start-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/which-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest-screenshots/which-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"name": "brid.gy",
Copy link
Owner

Choose a reason for hiding this comment

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

Bridgy

Copy link
Author

Choose a reason for hiding this comment

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

manifest needs a name

Copy link
Owner

Choose a reason for hiding this comment

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

Sure, I meant to change it to "Bridgy", not remove it

Copy link
Author

Choose a reason for hiding this comment

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

:D

"short_name": "brid.gy",
"description": "📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...",
"id": "/",
"start_url": "/",
"scope": "/",
"lang": "en",
"dir": "ltr",
"theme_color": "#428ef4",
"background_color": "#ffffff",
"display": "standalone",
"orientation": "portrait-primary",
"related_applications": [],
Copy link
Owner

Choose a reason for hiding this comment

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

probably remove these two?

Copy link
Author

@kristofzerbe kristofzerbe Jul 13, 2024

Choose a reason for hiding this comment

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

Not necessary

Copy link
Owner

Choose a reason for hiding this comment

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

Not necessary, but I'd like to, since they're optional 😁 https://developer.mozilla.org/en-US/docs/Web/Manifest#members

Copy link
Author

Choose a reason for hiding this comment

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

Misunderstanding here from my side :D. I meant: They are not necessary, because optional

"prefer_related_applications": false,
"icons": [
{ "src": "manifest-icons/icon-72x72.png", "sizes": "72x72", "type": "image/png" },
Copy link
Owner

Choose a reason for hiding this comment

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

These aren't all necessary, right? I'd rather avoid maintaining lots of new logo files. Should we maybe just use some of the existing static/bridgy_logo* files?

Copy link
Author

Choose a reason for hiding this comment

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

Many different devices types needs different icons. These are the minimum for Chrome, Safari, Edge and so on.

Copy link
Owner

Choose a reason for hiding this comment

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

Huh. Do those browsers not resize existing icons if there's not already a preferred size? Got a link with details?

Copy link
Author

Choose a reason for hiding this comment

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

It's best practice many of these generators also use and low level for the main OS's Android and iOS. For one of my PWAs, I took the effort to look at all the specs and came up with over 80 icons, including the maskable stuff :)

https://stackoverflow.com/questions/48839338/which-icon-sizes-are-required-for-progressive-web-apps-pwa-as-of-q1-2018

Copy link
Owner

Choose a reason for hiding this comment

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

Hmm. It sounds like the major browser and platforms generally scale down icons fine: GoogleChrome/lighthouse#291 (comment)

Copy link
Author

Choose a reason for hiding this comment

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

My experience is rather "should", but it is actually more of a marginal problem. Therefore, two or three slightly larger icons are also adequate

Copy link
Owner

Choose a reason for hiding this comment

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

Great! There are currently six JPGs with opaque white background and five PNGs with transparent background, across a range of sizes and aspect ratios. Maybe we start with these, either some or all of them, and see how it goes?

  • bridgy_logo.jpg
  • bridgy_logo_128.jpg
  • bridgy_logo_16.jpg
  • bridgy_logo_75.jpg
  • bridgy_logo_square.jpg
  • bridgy_logo_square_1024.jpg
  • bridgy_logo_with_alpha.png
  • bridgy_logo_with_alpha_128.png
  • bridgy_logo_with_alpha_16.png
  • bridgy_logo_with_alpha_75.png
  • bridgy_logo_with_alpha_square_1024.png

{ "src": "manifest-icons/icon-96x96.png", "sizes": "96x96", "type": "image/png" },
{ "src": "manifest-icons/icon-128x128.png", "sizes": "128x128", "type": "image/png" },
{ "src": "manifest-icons/icon-144x144.png", "sizes": "144x144", "type": "image/png" },
{ "src": "manifest-icons/icon-152x152.png", "sizes": "152x152", "type": "image/png" },
{ "src": "manifest-icons/icon-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "manifest-icons/icon-384x384.png", "sizes": "384x384", "type": "image/png" },
{ "src": "manifest-icons/icon-512x512.png", "sizes": "512x512", "type": "image/png" }
],
"screenshots": [
{
"src": "manifest-screenshots/start-desktop.png",
"sizes": "1200x850",
"type": "image/png",
"form_factor": "wide",
"label": "Start Page"
},
{
"src": "manifest-screenshots/which-desktop.png",
"sizes": "1200x850",
"type": "image/png",
"form_factor": "wide",
"label": "Choose Service Page"
},
{
"src": "manifest-screenshots/mastodon-desktop.png",
"sizes": "1200x850",
"type": "image/png",
"form_factor": "wide",
"label": "Mastodon Page"
},
{
"src": "manifest-screenshots/responses-desktop.png",
"sizes": "1200x850",
"type": "image/png",
"form_factor": "wide",
"label": "Responses Page"
},
{
"src": "manifest-screenshots/start-mobile.png",
"sizes": "410x800",
"type": "image/png",
"form_factor": "narrow",
"label": "Start Page"
},
{
"src": "manifest-screenshots/which-mobile.png",
"sizes": "410x800",
"type": "image/png",
"form_factor": "narrow",
"label": "Choose Service Page"
},
{
"src": "manifest-screenshots/mastodon-mobile.png",
"sizes": "410x800",
"type": "image/png",
"form_factor": "narrow",
"label": "Mastodon Page"
},
{
"src": "manifest-screenshots/responses-mobile.png",
"sizes": "410x800",
"type": "image/png",
"form_factor": "narrow",
"label": "Responses Page"
}
]
}
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<link rel="stylesheet" href="/oauth_dropins_static/bootstrap.min.css" />
<link rel="stylesheet" href="/oauth_dropins_static/util.css" type="text/css" />
<link rel="stylesheet" href="/static/style.css" type="text/css" />
<link rel="manifest" href="/static/manifest.json" />

<script async src="/static/bridgy.js"></script>
<!-- Not async because it adds a DOMContentLoaded event listener, which may
Expand Down
Loading