Skip to content

isSafari regex check doesn't catch WebKit webview in Tauri browser #7476

@camdecoster

Description

@camdecoster

Description

As discussed in the private repo issue plotly/plotly-studio#1123, some logic isn't working properly in the WebKit webview in Tauri because the user agent string regex check that plotly.js performs doesn't return true. We should update the regex check to match in this case.

Steps to reproduce

  • Copy this code into a DevTools or Node console (based on this plotly.js code):
    let userAgentString = "SOME_STRING";
    /Version\/[\d\.]+.*Safari/.test(userAgentString);
  • Update the tested string to "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15"
  • Run the test and note that it returns true
  • Update the tested string to "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)"
  • Run the test and note that it returns false

Notes

  • There's some discussion of the problem in this Tauri issue report

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions