Changing favicon.ico during runtime

Hello,

i want to change my favicon during the runtime. If vaadin starts, we want to change the icon dynamically because of an flag in the database. The only way i found is to change the complete theme. But if we copy our theme only to change the icon it will be a problem because we have all css information twice time and if we add a css information we have to it in both themes.

Is there a practically way to change the icon during runtime?
Thanks
Benjamin Hirschkorn

You could try using a JavaScript snippet like here: https://stackoverflow.com/questions/260857/changing-website-favicon-dynamically

-Olli

Hello, thank you for answering,

i found a solution for my problem. I habe a base.css outside the themes and two themes with different favicons, now i have in both themes a css with an @import url(“…/Base.css”);
Now i can change the theme to get an other favicon.

Ha, I guess that’s one way of doing that, too :slight_smile:

-Olli