DEV Community

Discussion on: Adding a dynamic favicon with users scroll percentage

Collapse
 
belinde profile image
Franco Traversaro

probably you should change changeFavicon() to not append a favicon every time, but replacing the old one instead. Appending only is a form of memory leak, because the DOM will increase indfinitely when the user scrolls up and down

Collapse
 
styxofdynamite profile image
Luke

Thanks I'll look into that when I get a chance and update accordingly.