Problems of PWAs — colorful paper-cut lettering above a paper smartphone with a torn screen.

Problems of PWAs

I have already written several articles about web development with Kotlin. It is really convenient to build side projects this way and make them available to users without going through app stores. PWAs (Progressive Web Application) are the best fit for this. But I will talk more about that in the next article. Today, I want to be a bit negative. Let’s discuss some PWA problems that are almost impossible to fix from inside the app, no matter which language or UI framework you use. In other words, most of these problems come from browsers. And I will start with the most annoying one.

Insets #

For years now, Android and iPhone apps have needed to support edge-to-edge layouts. This means making sure your app displays correctly around screen cutouts and behind system bars. But on the web, it is a mess. No browser has properly implemented support for insets yet. It feels strange to say this, but Safari has come the closest. Here are a few screenshots of the exact same simple web app, written in JavaScript and HTML, running on Android and iPhone.

Insets in the same web app, screenshot 1

Insets in the same web app, screenshot 2

Insets in the same web app, screenshot 3

Insets in the same web app, screenshot 4

Insets in the same web app, screenshot 5

You can try the app here: https://demo-insets.pages.dev

Launcher icon #

The next problem is about looks. And it only affects Android with the default launcher. To me, the whole point of PWAs is to use web apps that are indistinguishable from native apps. But for some reason, the Android launcher only puts their icons on the home screen and adds a small badge with the icon of the browser used to install the app. You do not see this on iPhones or Samsung phones, for example. You do not see it on desktop either. But the default Android launcher does this, and it really bothers me. Basically, this immediately turns PWAs into second-class apps. Sad.

PWA icons in the Android launcher

Clearing data for a single app #

These problems are not listed in any particular order. I am just writing them down as I remember them. So, here is another problem I keep running into. I like to keep my devices reasonably clean and tidy. So from time to time, I use the option to clear the browser cache when closing it. But this also clears the data of all my installed PWAs. This may not be obvious at first, since the whole idea is for PWAs to look like natively installed apps. So now I have to think twice before clearing my browser history. There is a workaround, but it is quite a hassle. You have to open the browser history in settings and delete data for visited sites one by one, making sure you do not accidentally touch the data belonging to your PWAs.

Tied to a browser #

The next problem follows naturally from the previous one. Installed PWAs are tied to a specific browser. If you decide to switch to another browser or simply uninstall the current one, all your PWAs will quietly disappear too. Nobody will warn you about this beforehand.

Splash screen #

Every app has a pause before it shows the main UI. During that time, it loads data and resources, compiles things, and so on. In native development, the system lets you configure a splash screen for this. The options are limited, of course, but you can still make something nice for the user. PWAs do not have this option. The browser controls the splash screen, which usually shows your app icon in the center and the app name at the bottom. There are no customization options here.

PWA splash screen

Wasm compilation at startup #

The next problem is purely technical. I think it will be fixed in future browser versions. But right now, if your PWA uses Wasm, the browser compiles it again before every launch. From the user’s point of view, this means staring at a splash screen for quite a while every time they open the app. And we all know that even a small delay makes people spend less time using an app. So I consider this a real problem.

Back gesture #

Again, we want installed PWAs to behave as much like native apps as possible. Native apps support common interaction patterns. One example is the gesture for going back to the previous screen. Unfortunately, for various reasons, browsers do not currently support this feature. I do not mean the back gesture itself. I mean being able to customize the transition animation between screens. Yes, I know Apple has added something along these lines in recent versions of Safari. But it only simulates the screen transition: the previous screen is basically a screenshot of what it looked like before you navigated forward. Once the gesture is complete, users usually see a flicker as the screen updates to the correct state. All we can do is hope that the developers of Chrome and other browsers will do it differently. But they will do it eventually. They will, right?

Padmé meme: They will, right?

Loading files into memory #

Here is another technical problem that users may not even know about. PWAs, or rather browsers, cannot read files directly from the user’s file system. For example, suppose you want the user to select a photo, edit it, and then upload it to your server. In a native app, the original photo can simply stay in the file system. But in a browser, you need to load the entire photo into the app’s memory to display it. Now imagine you are building a video editor.

Fonts #

For historical reasons, browsers have a huge number of security restrictions. Maybe that is for the best. You can never have too much security. For example, you cannot even get a list of fonts installed on the system, because it can be used to fingerprint the user. A similar but separate problem is that you cannot use system fonts from inside a Wasm app. So every user has to load a font into memory just to render text in your app. Does it work? Yes. But it could be better.

A very popular and useful feature is opening a service’s links in its app, not on the home screen, but on a specific screen related to the link. These are called deep links. Unfortunately, I have not found a way to configure deep links for PWAs. The original browser always opens instead of the PWA. That sucks.

Smooth resizing #

Maybe this is not critical. Some people say it is a rare use case. But for me, it is a litmus test. To see whether an app is native and fast, I always grab a corner of its desktop window and start resizing it. If I see the UI stutter and flicker, that immediately tells me the app is not native. Though I have heard that things are pretty bad on Windows these days anyway. So, even putting PWAs aside: when you resize a browser window, the content inside always jumps and stutters. No amount of UI framework optimization can fix that. We recently optimized Compose apps on the JVM, for example, so resizing is now very smooth.

Firefox #

I was a loyal Firefox user for more than fifteen years. You could say I barely used any other browser. But Firefox does not support PWAs!!! At all. That was the last straw that made me switch to Vivaldi.

Safari #

I think complaining about web development in Safari is getting a bit old. But I cannot ignore the fact that Apple broke all Wasm apps in a recent RC release. And because the bug was in the browser engine itself, there was no way for us to fix it on our side. The breakage happened between the beta and RC releases, of all times. It simply looked as if the app had failed to load. The user saw a white screen. From the user’s point of view, the problem was obviously in the app, not the browser. Same as always. I hope nobody updates to RC versions of browsers. Right?

Dog meme about PWA problems

Conclusion #

So, that is my list of PWA problems. As I said, unfortunately, we cannot fix them on the Kotlin side or in the Compose UI framework. But despite all this, I still believe in the power of this approach. So in the next article, I will try to explain what makes PWAs so good after all. And why I now prefer them for my side projects.

Comments