tommoor / tinycon

A small library for manipulating the favicon, in particular adding alert bubbles and changing images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regexp/Delete too aggressive?

justinaray opened this issue · comments

Looking at the source and my head tag, it looks like all of my supplemental icon links are being removed. Specifically, this includes the apple-touch-icon[-precomposed].

Is this necessary to ensure the tinycon dynamic icon is applied on all platforms? Would it be possible to whitelist in some rel types that shouldn't be removed?

tinycon is 💯 btw!

Using document.querySelectorAll('head link[rel~="icon"]') could also be an approach instead of whitelisting. It would select just link tags that contain an icon string in the rel attribute.

Presumably, it would be acceptable to remove all of these tags as they are favicon candidates.