question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Safari is not detected properly

See original GitHub issue

Hi,

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:

  1. Use following .browserlistrc
Safari >= 12.1
  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

  1. Test the UA with the generated regex:

What was the idea behind patching of Safari regex? For us, it only works, when we remove this code.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dangreencommented, Oct 18, 2022

@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.

1reaction
dangreencommented, Oct 15, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found