this post was submitted on 28 Aug 2023
19 points (85.2% liked)

Firefox

17857 readers
1 users here now

A place to discuss the news and latest developments on the open-source browser Firefox

founded 5 years ago
MODERATORS
 

I’m wonder if its possible to change or refresh tab favicons and only favicons (without refreshing whole tabs). I looked through some pages on MDN and about WebExtensions but I haven’t found any search bars. I’ve also done Google searches specifically for that with no luck.

you are viewing a single comment's thread
view the rest of the comments
[–] MrOtherGuy@lemmy.world 5 points 2 years ago* (last edited 2 years ago)

There isn't anything to specifically update the favicon of a tab. But you can do the exact same thing websites can update their favicon with; run a content script on the web page that modifies the favicon. Firefox will then show whatever the new icon image is in the tab bar.

I don't have a better example but the content script of an extension I wrote updates the favicon during media playback in a tab. As an overview it creates a canvas of the original favicon, creates a new link element as the "new favicon", updates that canvas during playback, and then sets the created link element href attribute to the data uri created from the canvas.