Birkbjo / OctoPrint-Themeify

Beautiful themes for OctoPrint
94 stars 35 forks source link

[REQUEST] Change favicon #108

Open tvirelli opened 3 years ago

tvirelli commented 3 years ago

I have multiple Octoprint instances for my printers. I "pin" them in my browser, so all I can see is the favicon. I would love the ability to change the favicon. I think this can be done with some javascript to just overwrite the included icon.

I have confirmed that adding the code below to the dashboard.js file works. Unfortuantly I'm not familiar enough with OctoPrint plugins to do a pull request for this and it would also need integration into the settings page.

//Themeify coloring
var style = $('<style id="dashboard_themeify_style_tag"></style>');
$('html > head').append(style);

// Start added code for custom favicon
$('head > link[rel="mask-icon-theme"][rel="mask-icon"][rel="apple-touch-icon"][rel="shortcut icon"][rel="manifest"]').remove();
$('head').append('<link rel="icon" type="image/png" href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/271/rose_1f339.png">');

I am good with using a URL instead of file upload as shown in the code above, but also allowing an image upload would be nice as well.

Thanks for your consideration.

Birkbjo commented 3 years ago

Makes sense, I will look into this!