favorite-icon
v1.1.2
Published
Small library for manipulating desktop favicon
Downloads
64
Readme
⭐ Favorite Icon
Small library for manipulating desktop favicon.
Desktop browser support
- Chrome: ✅
- Edge: ✅
- Firefox: ✅
- Opera: ✅
- IE: ❌
- Safari: ❌ (Safari hides favicons)
Advantages
- data: and canvas support
- GIF, JPEG, PNG, SVG and other browser-supported formats
- Ultra-small code size
Installation
npm install favorite-icon
Using
import { Favicon } from 'favorite-icon';
Favicon.set('/my-icon.png');
API
Favicon.set(src: string | HTMLCanvasElement)
Set the favicon with your own image.
import { Favicon } from 'favorite-icon';
Favicon.set('./image.png');
// or
Favicon.set('data:image/png;base64,...');
// or
const canvas = document.createElement('canvas');
//...
Favicon.set(canvas);
Favicon.reset()
Reset the favicon.
import { Favicon } from 'favorite-icon';
// ...
Favicon.reset();
License
MIT License
Packages
| Num. | Package | Demo | Version | Download | | ---- | -------------- | -------------- | ------- | ------ | | 1. | ⭐ Favorite Icon | Demo | | | | 2. | 📛 Favorite Icon Badge| Demo | | | | 3. | 😃 Favorite Icon Emoji | Demo | | | | 4. | ⚠️ Favorite Icon Status | Demo | | | | 5. | ⏩ Favorite Icon Video | Demo | | | | 6. | 🔴 Favorite Icon Dot | Demo | | | | 7. | ⏱️ Favorite Icon Timeout Worker | Demo | | |