Skip to content

Commit

Permalink
Add "prerender" to the bot list so lazy loading won't be active when …
Browse files Browse the repository at this point in the history
…the prerender.io bot visits the page (#545)

Co-authored-by: Csaba Varro <csaba@prerender.io>
  • Loading branch information
varrocs and Csaba Varro committed May 22, 2022
1 parent 064d647 commit 05db89b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared-hooks/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export abstract class SharedHooks<E> extends Hooks<E> {

isBot(attributes?: Attributes): boolean {
if (this.navigator?.userAgent) {
return /googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|duckduckbot/i.test(
return /googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|duckduckbot|prerender/i.test(
this.navigator.userAgent
);
}
Expand Down

0 comments on commit 05db89b

Please sign in to comment.