Does not work in WKWebView
The check in https://github.com/xtermjs/xterm.js/blob/master/src/common/Platform.ts#L21:
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
doesn't seem to catch WKWebView, which is the browser engine powering Safari. Safari's user agent string (on an iPad) is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15
Whereas WKWebView's user agent string (on an iPad) is:
Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
This is causing the demo on https://xtermjs.org to not show any content in WKWebView.
@litherum do you know of an easy way to test a wkwebview on a macbook?
@litherum I have applied a quick workaround on my own SSH app (now using Xterm.js).
A simple fix could be :
wkWebView.customUserAgent = @"Anything Safari";
Then the WebGL rendering is disabled and the terminal works as it should.
Yeah we check for "safari" in the user agent right now: https://github.com/xtermjs/xterm.js/issues/3357#issuecomment-993172813
This just needs someone with a device that can verify a fix works for the webkit webview and doesn't break Chrome, etc. since user agents are a mess.
I believe this can be close now