20250210

Mondays start with merging pull requests by Dependabot.

I’m done with the naturalization interview, so I think I should start practicing English conversations now.

I’ve been listening to “golden hour” by JVKE. I want to die in that atmosphere.

I’m too productive today. I wonder what will happen to my body tomorrow.



Progressive Web App / Web Application Manifest

Progressive Web App

Progressive Web App (PWA) is specific type of web applications that are built with standard web technologies such as HTML, CSS, and JavaScript, but it can be installed on a device and behaves like a native mobile application.

According to the article, the requirements of a Progressive Web App are:

With the requirements met, browsers that support PWA can install the application to devices.

According to these resources (please don’t blame me for referring a Wikipedia page), Chromium-based browsers support PWA, but other browsers do not support in many cases.

One of the PWA’s benefits is its closs-platform nature that reduces developers’ burdens. Another key feature is PWA can process real-time notifications thanks to service workers (TODO: Check how it works, Service Worker API - Web APIs | MDN).

Web Application Manifest

A progressive web app must have manifest.json to let browsers install it, though its use case is not limited to PWA.

manifest.json is used to guide browsers on how PWA should be displayed or behave.

Since Mastodon can be run as a Progressive Web App, we can take a look at mine ocalaavenue.net/manifest.json

{
  "id": "/home",
  "name": "Ocala Ave",
  "short_name": "Ocala Ave",
  "icons": [
    ...(omitted)...
    {
      "src": "https://ocalaavenue.net/packs/media/icons/android-chrome-192x192-eddc1ed540e97b926202b7b857989d60.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any maskable"
    },
    ...(omitted)...
    {
      "src": "https://ocalaavenue.net/packs/media/icons/android-chrome-512x512-ccb53c9fcbb5f61bf741cc54998318f0.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any maskable"
    }
  ],
  "theme_color": "#191b22",
  "background_color": "#191b22",
  "display": "standalone",
  "start_url": "/",
  "scope": "/",
  "share_target": {
    "url_template": "share?title={title}&text={text}&url={url}",
    "action": "share",
    "method": "GET",
    "enctype": "application/x-www-form-urlencoded",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url"
    }
  },
  "shortcuts": [
    {
      "name": "Compose new post",
      "url": "/publish"
    },
    {
      "name": "Notifications",
      "url": "/notifications"
    },
    {
      "name": "Explore",
      "url": "/explore"
    }
  ]
}

Top level keys are called members, and according to MDN, these are the required fields for PWAs.

You can see that the Mastodon’s manifest.json meets the requirements.

How to install with Google Chrome

  1. Open ocalaavenue.net or any website you want to install
  2. Select “More” at the top right -> Cast, save, and share -> Install … as app

Wow, I didn’t know that I could install a web application like a native application. (How many people are aware of this?)


TODO:


index 20250209 20250211