-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
feat: don't autoblock non-chrome browsers #2096
feat: don't autoblock non-chrome browsers #2096
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/athens-research/athens/5fj9LuzZZUMXUwR1qFMh9VtgHV1o |
Best reviewed with the |
29169e5
to
e034add
Compare
Browsers
OSes
|
I tested on Mac with chrome/brave/edge/firefox and they seem to work. Safari on mac does not work, neither does iOS Safari or Chrome (same engine). Safari on mac throws this error:
I traced it down to some lookbehinds we have on regexes (both We have a lot of lookbehinds in our parser so that's definitely not easy to refactor, and I can see in Safari over a dev build that these are a problem: |
This reverts commit 81324e0.
Athens uses js regex lookbehinds that are not yet supported in Safari athensresearch#2096 (comment) Safari on MacOS and iOS, as well as all Safari based browsers on iOS (chrome etc, all really), will show a AppleWebKit user agent. https://www.whatismybrowser.com/guides/the-latest-user-agent/safari https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/ios/user_agent.md#:~:text=The%20User%20Agent%20(UA)%20in,of%20Version%2F%20.
e034add
to
ee33753
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
resources/public/index.html
Outdated
function isBrowserSupported() { | ||
return userAgent.indexOf("chrome/") > -1; | ||
function isBrowserUnsupported() { | ||
return userAgent.indexOf("applewebkit/") > -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't right, the user agent for chrome under macos is 'mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/100.0.4896.75 safari/537.36'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brave is also the above.
Firefox is "mozilla/5.0 (macintosh; intel mac os x 10.15; rv:98.0) gecko/20100101 firefox/98.0"
.
Safari is "mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/605.1.15 (khtml, like gecko) version/15.4 safari/605.1.15"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this check and can verify it works as follows:
MacOS:
- Safari shows the
Safari based browsers based are not supported
message - Chrome, Firefox and Brave don't
iOS:
- All browsers show the
Safari based browsers based are not supported
message.
Just for the record, I confirmed the demo site now works on Ubuntu in both Firefox v99.0 and Brave v1.37.116 (Chromium 100.0.4896.127). |
Close #1718
Close #1705
I tried this PR on firefox and it seems to open ok, so I guess the
case
problem in those issues went away.