How to add icon to webPage/Frame

Hello All.

Is there a way to add an icon to a web page/frame? I would like an icon to appear in the browser tab alongside of the Frame/Page Title


if XOJO doesn’t add this, do this manually in the Head section:

<link rel="apple-touch-icon" href="icon.png" />

More info:

If an icon is added to App, it should show in the tabs. I verified that it exists in the DOM. Note that when running local, you must choose another port than 8080 or empty the browser cache for it to show.

I was hoping to use a different icon for each page. Not the app Icon which does show.

I see no way to achieve that. As it happens, even if through JavaScript you change the page icon as outlined in the page that Tomas linked to, it is too late : the tab icon is already loaded.

Edit : I just tried, but as I feared, at least in Chrome, changing the icon in the DOM does not change the tab icon.

Don’t know how to do it in Xojo, and it will only work in some browsers like Chrome and Firefox (probably not in IE or Edge)
Try something like this (changes every second):

    <link id="icon" rel="shortcut icon" type="image/png" href="" />    
        var last = 0;
        var icons = ['', '', '','',''];        
        setInterval(function () {                   
            document.getElementById('icon').href = icons[(++last % icons.length)];            
        }, 1000);