change(ios): Inject viewport meta tag with readystate
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
That sounds fine to me; @darcywong00 can you open an issue on that? I think we should do the same pattern for iOS and Android.
_Originally posted by @mcdurdin in https://github.com/keymanapp/keyman/pull/4531#discussion_r587750487_
atm, Android uses this pattern to inject the viewport meta tag:
```java
public static void injectViewport(WebView webView) {
if (webView != null) {
webView.loadUrl(
"javascript:(function() {" +
"if(document.head && !document.querySelectorAll('meta[name=viewport]').length) {"+
"let meta=document.createElement('meta');"+
"meta.name='viewport';"+
"meta.content='width=device-width, initial-scale=1';"+
"document.head.appendChild(meta);"+
"}"+
"})()"
);
}
}
```
When web implements #4555 we can use a similar pattern with iOS
Contributor guide
Assessment
This issue has not been assessed yet.