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

Use isbot package to detect robot #15

Closed
krokyze opened this issue Mar 5, 2022 · 4 comments
Closed

Use isbot package to detect robot #15

krokyze opened this issue Mar 5, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@krokyze
Copy link
Collaborator

krokyze commented Mar 5, 2022

Potentially it could be better to use something like this https://www.npmjs.com/package/isbot to detect the robot:

<script>
  if (isbot(navigator.userAgent)) {
    window.flutterWebRenderer = "html";
  }
</script>

And pass simple boolean down to RobotDetector dart code, just that I'm not that familiar with NPM and how to use it within html.

@krokyze krokyze added the enhancement New feature or request label Mar 5, 2022
@iamSahdeep
Copy link
Owner

@krokyze Is it for users to enable html as web renderer?
Or should we use it to detect bot? internally it seems like this package is also using regexp from list of predefined bots mentioned in the list here https://github.com/omrilotan/isbot/blob/main/src/list.json

@krokyze
Copy link
Collaborator Author

krokyze commented Mar 9, 2022

@iamSahdeep yep that would then be used to detect the bot, and we wouldn't need to have the same regex in dart code.

@clragon
Copy link

clragon commented Apr 9, 2022

adding a package like that to a flutter web project sounds tedious;
borrowing their regex list would be quite easy though.

@krokyze
Copy link
Collaborator Author

krokyze commented Apr 10, 2022

adding a package like that to a flutter web project sounds tedious; borrowing their regex list would be quite easy though.

I feel copy pasting one of 100 available StackOverflow solutions is not ideal as no one has time to keep track of new robots appearing.

But as after some discussions in #1 seems like robot detection isn't quite valid solution so I'm closing this idea.

@krokyze krokyze closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants