How to ask for persistent storage permission in Google Chrome

TL;DR: You can’t. Google Chrome is made by a bunch of morons who think they know better than anyone what you want to do.

Firefox’s way

Here is how it works on Mozilla’s Firefox:

Quite simple, straightforward and makes sense. The user is in control of what he wants to do.

Chrome’s way

Now here is what happens on Google Chrome:

What the hell?

Checking navigator.permissions.query({name:'persistent-storage'}).then((result) => console.log('result', result)) will show state: 'prompt'… Yeah right, where is the prompt then?

Basically, Google Chrome decides if it thinks your site/app is worthy of persistent storage or not.

In various places is said what the criteria are, but I haven’t found an official Google-authored page stating it. Usually something like that:

Given the first point is not actionable (bullshit value with no definition, so no way to measure it… something that does not have its place in any software API), we can try the others:

Maybe it’s another sneaky way from Google to:

It looks like a privacy-respecting local-only PWA is not something Google wants.

Anyway, the message is quite clear, what Googlers think of “normal” people: 🖕

Let them be assured that the feeling is mutual.

Comments Add one by emailing me.