Skip to content

Does not work in WKWebView #3575

@litherum

Description

@litherum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions