iamSahdeep/seo_renderer

Use isbot package to detect robot

Closed this issue · 4 comments

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

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

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

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.