NEW218122
[GTK] Chassis type check does not work in flatpak
https://bugs.webkit.org/show_bug.cgi?id=218122
Summary [GTK] Chassis type check does not work in flatpak
Michael Catanzaro
Reported 2020-10-23 06:07:11 PDT
The chassis type check added in r264213 does not work in flatpak because it depends on /etc/machine-info, which is not available inside the sandbox. Jan-Michael proposed mounting it in the sandbox in https://github.com/flatpak/flatpak/pull/3727, but this was rejected upstream. This means WebKit sends a desktop user agent even if a mobile user agent is required.
Attachments
Alice Mikhaylenko
Comment 1 2020-10-23 07:03:58 PDT
Hmm right. Can we access hostnamectl somehow?
Michael Catanzaro
Comment 2 2020-10-23 07:56:33 PDT
I'm not sure what would be acceptable for upstream flatpak. My guess is a chassis type portal would probably be acceptable. We should figure out what upstream is willing to accept before we implement something.
Michael Catanzaro
Comment 3 2021-06-30 08:11:37 PDT
Note this bug is really specific to flatpak only. It's not a problem for our bubblewrap sandbox because all of /etc is available in the bubblewrap sandbox.
Michael Catanzaro
Comment 4 2022-12-14 05:59:18 PST
We were discussing this today. Instead of implementing a portal to fix the ChassisType check, we should instead delete the code and stop using chassis type. Currently it's only used for setting a mobile user agent header. Instead, we should check window size and touchscreen presence to decide whether to pretend to be a mobile device. However, WebKit itself does not have enough info to decide whether we are in mobile mode because it doesn't know what window size the browser uses as cutoff to switch between mobile UI vs. desktop UI. So I'm not sure quite how to do this. Some new API will probably be needed.
Alice Mikhaylenko
Comment 5 2022-12-14 06:01:24 PST
From my pov the ideal would be to just a flag to opt into using mobile UA for a particular tab. That's how it works in basically every single existing mobile browser, incl. Safari on iOS. Then the app can figure out if/when to show an option for it - e.g. when the window is small.
Note You need to log in before you can comment on or make changes to this bug.