favicon_plus 0.1.0 copy "favicon_plus: ^0.1.0" to clipboard
favicon_plus: ^0.1.0 copied to clipboard

Resilient favicon discovery for modern websites.

favicon_plus #

favicon_plus is a Dart favicon discovery library designed for modern websites that may serve different HTML to bot-like clients.

It keeps a drop-in-friendly API similar to favicon (FaviconFinder.getAll / getBest) while improving reliability by:

  • sending browser-like default headers (instead of Dart's default user-agent),
  • retrying known security-challenge responses with a fallback user-agent,
  • parsing <link rel="...icon..."> tags,
  • parsing icons from web app manifests,
  • checking common fallback paths (/favicon.ico, etc.),
  • validating downloaded icon content before returning results.

Based on favicon.

Installation #

dart pub add favicon_plus

Usage #

import 'package:favicon_plus/favicon_plus.dart';

Future<void> main() async {
  final all = await FaviconFinder.getAll('https://www.paodeacucar.com/');
  final best = await FaviconFinder.getBest('https://www.paodeacucar.com/');

  print('Found ${all.length} icons');
  print('Best: $best');
}

Optional configuration #

final icons = await FaviconFinder.getAll(
  'https://example.com',
  timeout: const Duration(seconds: 30),
  suffixes: ['png', 'ico'],
  headers: {'Accept-Language': 'pt-BR,pt;q=0.9,en;q=0.8'},
);

End-to-end tests #

This package contains live-network e2e coverage for:

  • https://www.paodeacucar.com/
  • https://www.amazon.com/
  • https://www.ifood.com.br/
  • https://www.mercadolibre.com/
  • https://www.pedidosya.com/
  • https://www.ebay.com/

Run all tests:

dart test

Run only e2e tests:

dart test -t e2e
0
likes
150
points
500
downloads

Publisher

unverified uploader

Weekly Downloads

Resilient favicon discovery for modern websites.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

html, http, image

More

Packages that depend on favicon_plus