Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem that isWebkit be true on Chrome #629

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

E-train-Liu
Copy link

The user agent on Chrome also contains AppleWebKit。 Therefore the origin judgement condition will treat Chrome as "WebKit inside a native macOS app".

Here is the user agent string of Chrome 80 for Windows 10:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36

The user agent on Chrome also contains `AppleWebKit`。 Therefore the origin judgement condition will treat Chrome as "WebKit inside a native macOS app".

Here is the user agent string of Chrome 80 for Windows 10:

```
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36
```
@evgeniy-polyakov
Copy link

evgeniy-polyakov commented Mar 7, 2020

It's true on almost all platforms except of Firefox on Linux: https://deviceatlas.com/blog/list-of-user-agent-strings
Excluding Chrome does not help much. I suggest to use a check specific for Chrome iOS as only this browser has problems with download attribute: #612

@rajivshah3
Copy link
Contributor

Yikes, you're right. That was my fault, I'm not sure how I missed that. I'll look into another way to detect webviews inside native macOS apps 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants