Bug 218122
| Summary: | [GTK] Chassis type check does not work in flatpak | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | alicem, bugs-noreply, jan.brummer, kdwkleung, mcatanzaro |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=149496 | ||
| Bug Depends on: | |||
| Bug Blocks: | 218121 | ||
Michael Catanzaro
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alice Mikhaylenko
Hmm right. Can we access hostnamectl somehow?
Michael Catanzaro
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
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
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
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.
Kdwk
https://gitlab.gnome.org/GNOME/epiphany/-/issues/1951