Safari is not detected properly
See original GitHub issueHi,
Safari is not detected properly under some circumstances. The reason is the following patched regex: https://github.com/browserslist/browserslist-useragent-regexp/blob/master/src/useragentRegexp/workarounds.ts#L75
Steps to reproduce:
- Use following
.browserlistrc
Safari >= 12.1
- Run CLI command
echo "$(browserslist-useragent-regexp --allowHigherVersions)"
This will result in the following Regex:
/(Version\/(12\.1|12\.([2-9]|\d{2,})|(1[3-9]|[2-9]\d|\d{3,})\.\d+|13\.0|13\.([1-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)/
Now, Safari on an iPad gives a UserAgent similar to this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6,2 Safari/605.1.15
- Test the UA with the generated regex:
- Result with original output: https://regex101.com/r/aslDDb/1 (Not found)
- Result without the patched regex mentioned above: https://regex101.com/r/wPYcxx/1 (Found)
What was the idea behind patching of Safari regex? For us, it only works, when we remove this code.
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:14 (3 by maintainers)
Top Results From Across the Web
If Safari on Mac doesn't open a webpage or isn't working as ...
If Safari on Mac doesn't open a webpage or isn't working as expected · Reload the page · Check Safari extensions · Check...
Read more >How to fix Safari not working on Mac? - MacPaw
Click the Apple menu. Select Force Quit. Choose Safari from the list of apps and click Force Quit.
Read more >Safari Not Working on Mac? 9 Ways to Fix
1. Force Quit Safari. If Safari just froze on you and is not working at all on your Mac, try force-quitting it. ·...
Read more >Safari Not Working on Mac/MacBook, How to Fix? (2022)
Safari not working on Mac, try these solutions · Check the network · Force quit Safari · Restart Mac · Clear the website...
Read more >8 Ways to Fix Safari Not Working on an iPhone - MakeUseOf
1. Turn Off Safari Suggestions · 2. Turn On Cellular Data for Safari · 3. Edit Your Screen Time Settings · 4. Clear...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@marcospulido fixed in ua-regexes-lite@1.1.2. Reinstall browserslist-useragent-regexp to trigger ua-regexes-lite update, or just install it as dev dependency.
@marteadrian-digando @rclarey @Zyxer22 Hi. Please try v4.0.0-beta.0.