favicon-swapper

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i favicon-swapper

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.4 kB

Total Files

4

Last publish

Collaborators

  • pikapower9080