Favicon in OH2?: Redux

Does anyone have instructions for how to add a favicon to the classic UI? There’s an open issue for officially fixing this but no activity in a while. @Kai appears to suggest modifying the classicui bundle but doesn’t say what to modify.

My comment was about adding icons for the iOS app.

Basic UI had been adapted accordingly here. On that issue I asked to also do the same for the Classic UI, but that apparently got lost…

I saw the iOS mention, but didn’t know there was a direct relationship between the classicui web app and the iOS application. Is the pattern used to fix the BasicUI the same as what’s required for the ClassicUI (updating patch/web/manifest.json)?

You are right, that does not make sense. The iOS splash screens were needed when using the webapp on an iOS device. It is not about the iOS app indeed!

Is the pattern used to fix the BasicUI the same as what’s required for the ClassicUI (updating patch/web/manifest.json)?

I would assume so, but I guess we will only find the answer if someone tries it out…

I can live without the favicon but it makes it harder to find my OH2 tab in a browser with many tabs. It was a nice feature of the OH1 classic UI and it’s unfortunate it didn’t survive the OH2 transition.

To summarize what I think you’ve said: 1) the original suggestion was only for iOS icons and not favicons, 2) users should dig into the OH2 source code and investigate how to modify the classic UI if they want a favicon for that web app.

Maybe the core developers are waiting for a bounty? :wink:

If anybody else is missing their OH2 favicon, one option is to use GreaseMonkey (FireFox) or TamperMonkey (Chrome, Microsoft Edge, Safari, Opera Next, and Firefox) to inject the favicon into the page source when the page is loaded in the browser. The following code injects the community forum favicon into the classic UI page. I used TamperMonkey but the script should work with GreaseMonkey too.

Note: you’ll need to change the @match URL pattern for your LAN.

// ==UserScript==
// @name         OH Favicon
// @namespace    http://stevebate.net/
// @version      0.1
// @description  Set the OH2 Favicon
// @author       Steve Bate
// @match        http://192.168.0.5:8080/classicui
// @grant        none
// ==/UserScript==

(function() {
    var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = 'https://community.openhab.org/uploads/default/original/1X/5fa0486dd08ec9b8212affbd727027f88865079e.ico';
    document.getElementsByTagName('head')[0].appendChild(link);
})();

See also: stackoverflow: Changing website favicon dynamically

@steve1 Good news - the favicon should now also be available in the Classic UI starting from distro 1025!

Great. Thanks!