keymanapp / keymanapp/keyman

feat(web): optional override of iOS Safari "Request Desktop Website" setting

Open
#2,271 0 comments 0 reactions 0 assignees View on GitHub
feat web/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

In iOS 13 Apple added the ability for Safari to set a "Request Desktop Website" option that then spoofs a desktop-macOS user agent string when enabled. (See also #2267.) It's enabled by default on iPads now, which caused significant breakage in our iOS app. This has been mitigated for stable with #2268, with the comment below in regard to a more complete desired implementation:

> There's one challenge here -- if a user has requested the desktop site but we use the mobile version of KMW, then there may be a disconnect in layout which the site owner has not intended.
>
> For example on keymanweb.com, we really should match the desktop layout with the desktop keyboard even on iPad, if that's what the user has requested. And vice-versa.
>
> One solution may be to include a `deviceMode` parameter or similar for KeymanWeb:
>
> `deviceMode = DEVICE_MODE.DETECT, DEVICE_MODE.TOUCH, DEVICE_MODE.DESKTOP`?
>
> * `DETECT` would be default and use the heuristics as per this PR
> * `TOUCH` would *always* show touch (and hence embedded would use this pathway)
> * `DESKTOP` would *always* show desktop
>
> Not sure what we have code-wise that already aligns with this but don't want to block off ways for site owners to use KeymanWeb in ways we may not have considered.
>
>

_Originally posted by @mcdurdin in https://github.com/keymanapp/keyman/pull/2268#issuecomment-548178449_

This primarily affects KeymanWeb (and its behavior when embedded in the iOS app).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.