@@ -202,3 +202,38 @@ describe(`_.info helper methods`, function() {
202
202
} ) ;
203
203
} ) ;
204
204
} ) ;
205
+
206
+ describe ( '_.isBlockedUA' , function ( ) {
207
+ [
208
+ 'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)' ,
209
+ 'Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)' ,
210
+ 'Mozilla/5.0 (compatible; AhrefsSiteAudit/6.1; +http://ahrefs.com/robot/site-audit)' , // Desktop
211
+ 'Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.128 Mobile Safari/537.36 (compatible; AhrefsSiteAudit/6.1; +http://ahrefs.com/robot/site-audit)' , // Mobile
212
+ 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)' ,
213
+ 'Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 530) like Gecko (compatible; adidxbot/2.0; +http://www.bing.com/bingbot.htm)' ,
214
+ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b' ,
215
+ 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' ,
216
+ 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)' ,
217
+ 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)' ,
218
+ 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' ,
219
+ 'facebookexternalhit/1.1' ,
220
+ 'Mozilla/5.0 (compatible;PetalBot;+http://aspiegel.com/petalbot)' ,
221
+ 'Mozilla/5.0(Linux;Android7.0;) AppleWebKit/537.36(KHTML,likeGecko) MobileSafari/537.36(compatible;PetalBot;+http://aspiegel.com/petalbot)' ,
222
+ 'Mozilla/5.0 (compatible; Pinterestbot/1.0; +http://www.pinterest.com/bot.html)' ,
223
+ 'APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)' ,
224
+ 'Mediapartners-Google' ,
225
+ 'Mozilla/5.0 (Linux; Android 5.0; SM-G920A) AppleWebKit (KHTML, like Gecko) Chrome Mobile Safari (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)' ,
226
+ 'FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)' ,
227
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +/search/docs/advanced/crawling/overview-google-crawlers)' ,
228
+ 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012; DuplexWeb-Google/1.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Mobile Safari/537.36' ,
229
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 Google Favicon' ,
230
+ 'Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko; googleweblight) Chrome/38.0.1025.166 Mobile Safari/535.19' ,
231
+ 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012; Storebot-Google/1.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36' ,
232
+ 'Screaming Frog SEO Spider/12.3' ,
233
+ 'Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse' ,
234
+ ] . forEach ( ( ua ) => {
235
+ it ( `should block bot user agent: ${ ua } ` , ( ) => {
236
+ expect ( _ . isBlockedUA ( ua ) ) . to . be . true ;
237
+ } ) ;
238
+ } ) ;
239
+ } ) ;
0 commit comments