Nighttab: Feature Request: custom favicon

Created on 27 Nov 2019  路  7Comments  路  Source: zombieFox/nightTab

Hello @zombieFox
It would be awesome if you could add an option to customize the favicon of the page.

For reference: https://stackoverflow.com/questions/260857/changing-website-favicon-dynamically

Here a mockup of what I had in mind:

Schermata 2019-11-27 alle 21 14 02 2

Very similar to how you handle the background, but with an text input instead of a textarea, and using the canvas API you can force a cut/resize so that localStorage doesn't complain.

Also supporting base64 strings would be cool.

enhancement investigate

All 7 comments

Thanks! Looks promising. I feel this should be possible. I'll investigate and see what I can do.

You can actually add in a one-liner to get the sites actual favicons from google, try this.

https://www.google.com/s2/favicons?domain=www.bing.com

this one actually lets you specify the icon size...

https://api.faviconkit.com/twitter.com/32

:edit > markdown:

Been investigating this issue. It does not look like new tab page extensions/addons support favicons. It seems to be blocked by the browser.

Copypasting this

(function() {
    var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = 'https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196';
    document.getElementsByTagName('head')[0].appendChild(link);
})();

Schermata 2020-06-15 alle 17 17 26

in the Debug Console properly update the favicon (note the stackoverflow icon on the New Tab page), so it seems doable to me, but I may be wrong.

Ah, seems like Firefox does show the favicon but Chrome does not. Nuts.

Yes, after a two minutes test (appending the snippet on nighttab.min.js and sideloading the extension) I can confirm that it works 100% of the times on Firefox and 0% on Chrome..

So if you decide to implement this (which I hope you'll do because it seems super cool) it would be a Web and Firefox only feat.

Nuts indeed.

Was this page helpful?
0 / 5 - 0 ratings