favicon-swapper
v1.0.0
Published
Swap a page's favicon with ease!
Downloads
1
Readme
favicon-swapper
Tiny zero-dependency library to swap page favicons with ease.
Why?
Most browsers don't listen for changes to favicon link tags. This means you can't simply change the href value of your link tag. This library aims to make the process of changing favicons more convenient, just a function call away.
How?
Favicon Swapper is an ESM module so it can be used in modern web browsers or with your favorite module bundling tool like webpack.
Example
<script type="module">
import { swap, swapColor } from 'favicon-swapper'
// Swap with an image
swap("https://example.com/image.png")
// Swap with a solid rgb color
swapColor([255, 255, 255])
swapColor(0, 0, 0)
</script>
Features
- Swap images with the call of a function
- Make your favicon a solid color thanks to favicolor