omrilotan / isbot

🤖/👨‍🦰 Detect bots/crawlers/spiders using the user agent string
https://isbot.js.org/
The Unlicense
921 stars 77 forks source link

v4.x.x is not working with Safari 15 and below #242

Closed cieniawska closed 7 months ago

cieniawska commented 7 months ago

Steps to reproduce

  1. Open Safari v15.x.x or below.
  2. Open any app that uses isbot function.
  3. See the following error appear: Screenshot 2024-02-15 at 15 50 10

this is how we use this function:

import { isbot } from 'isbot';
import { isUnsupportedBrowser } from '../functions/isUnsupportedBrowser/isUnsupportedBrowser';

const useSupportedBrowser = (): { isSupportedBrowser: boolean } => {
  const isSupportedBrowser: boolean = (
    !isbot(navigator.userAgent) &&
    !isUnsupportedBrowser()
  );

  return { isSupportedBrowser };
};

export default useSupportedBrowser;

Anything we can do to solve this issue?

omrilotan commented 7 months ago

Thank you for the issue. Can you please check which version specifically?

I added a fallback for unsupportive engines on 4.4.0 that should have taken care of this issue specifically.

omrilotan commented 7 months ago

I was able to reproduce it. Proposed resolution: #243

omrilotan commented 7 months ago

Resolution of isbot@5 tested on Safari 15.6

cieniawska commented 7 months ago

Thank you so much @omrilotan! it seems to be working for v13 and up.

However, there seems to be a different issue for Safari 11 and 12

Screenshot 2024-02-16 at 9 39 32

And seeing that it's still used on mobile devices, do you think there could be a possibility for a fix too?

omrilotan commented 7 months ago

Thank you, @cieniawska, I'm having trouble reproducing this. If you could provide any more information, I'd love to introduce a patch for it.

cieniawska commented 7 months ago

@omrilotan I use Safari v11.1 on Browserstack.
sorry for not being specific earlier on - it's about isbotMatch function it seems

Screenshot 2024-02-16 at 11 54 10
omrilotan commented 7 months ago

I'll try and test #244 on BrowserStack. Thanks

cieniawska commented 7 months ago

everything works perfect now, thank you! :)