Manifest orientation property


(Lars Willighagen) #1

A while back the manifest.json orientation property was changed from portrait to any. This, however, makes Chrome for Android ignore the native Android orientation lock, which makes it quite difficult basically impossible to read posts with your phone sideways. In fact, the Chrome docs even say:

Use this selectively. Users prefer selecting the orientation.

This makes me think any isn’t really the default. Could the property orientation simply be omitted? The Web App of dev.to for example, works fine for me and doesn’t have it set in its manifest.


(Jeff Atwood) #2

What do you think @falco?


(Rafael dos Santos Silva) #3

At first it was portrait and people asked for any in the link OP provided.

Then we got a PR changing to natural.

Then we got complaints and changed back to any.

:man_shrugging:

We can certainly do this. Let me research a bit and get back to you.


Android Auto-Rotate Disabled Not Respected with Discourse PWA
(Ryan Erwin) #5

I’ve noticed that while orientation is set to any, the system “orientation lock” is ignored.
Seems like the desired settings would be “same as chrome” (portrait/landscape based on how your holding the device, unless you’re using the system wide orientation lock)… but not sure what that translates to in W3C speak…

https://w3c.github.io/screen-orientation/#idl-def-OrientationLockType


(Alex Bass) #6

Same here, have been discussing it in this thread:


(Rafael dos Santos Silva) #7

Okay let’s try this:


(Alex Bass) #8

Looks great! This should remedy these issues - thank you so much for looking into this! :slight_smile:


(Daniel Hollas) #9

Hmm, do I need to re-install the PWA for this to take an effect? I was testing it here on meta and still have issues, even after restarting my phone.


(Rafael dos Santos Silva) #10

It’s like an app, uninstall it (in the app list in the OS settings or dragging the icon to the corner in some launchers) and then navigate to Meta to install again.

Manifest properties auto-update in the background for stuff like site name, logo and colors, but I don’t think orientation is one of those that updates.


(Lars Willighagen) #11

Thanks for the fix! I don’t think I can mark it as a solution, so a like and a reply will have to do.

I didn’t have to reinstall the PWA, but that may just be a coincidence.


(Rafael dos Santos Silva) #12

That good to know, thanks for the info. Those sneaky webapk updates are looking good.