Skip to content

yjbanov/crawler_detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helps Flutter and Dart apps detect when they are being crawled by a web crawler.

Features

This package pattern-matches the user agent string against a list of known patterns to detect a crawler.

The implementation can detect crawlers in all Dart web targets, including Flutter Web apps, and DOM-based Dart apps (e.g. those using Jaspr or AngularDart).

Dart VM targets are not web targets, and therefore you can never detect a crawler from within the Dart VM (e.g. command-line Dart apps, Flutter mobile or desktop apps).

Usage

Add a dependency to pubspec.yaml:

dependencies:
  crawler_detector: any

Import the package and use it:

import 'package:crawler_detector/crawler_detector.dart';

void main() {
  final bool isCrawlerUserAgent = detectCrawler();
  print('The current user agent is${isCrawlerUserAgent ? '' : ' not'} a crawler.');
}

About

Helps detecting web crawlers in Dart apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages