Multiple HTTPRequestHandler AddFaviconTag

Multiple HTTPRequestHandler AddFaviconTag

  

I'm trying out the HTTPRequestHandler's AddFaviconTag. I've put the Action into my eSpace common layout web block. That web block uses a site-wide layout which also uses AddFavIconTag in it's Preparation. The result is something like this:

link type="image/x-icon" rel="shortcut icon" href="/mySpace/img/favicon.ico"

link type="image/x-icon" rel="shortcut icon" href="/siteCommonSpace/img/favicon.ico"


IE and Edge are showing my eSpace favicon. Chrome shows the site one still. I can't find a spec saying which one the browser will use. Some examples show specifying different ones with different sizes so the browser can pick, but I'm using an .ico file with multiple sizes.

Is there a way to remove the common site eSpace link reference? I didn't find a RemoveFavIconTag. I tested adding another AddFavIcon call to the Web Screen just to see ordering. It's link comes before the other two, so it is Web Screen, then the local eSpace web block that it includes, then the site common eSpace web block that the local one includes.

It makes me wonder how the SetPageTitle Action works. If the last one set wins it is hard to override site defaults with this ordering.

Thank you for your insights,

Jacob


Hi Jacob,

You cannot remove a favicon, you must set it to something different. Usually what happens is that you will have a favicon for the theme and maybe you use a different one for each Module (eSpace), use the Resources for this, or you use that AddFavicon if you want to set a special one for a page.

If you have a page/Web screen that doesn't have a favicon set the browser will either not show an image (ex: Firefox) or show a default one (ex: Chrome).

Hi,


Why don't you add some optional input to the blocks that you need to control the behavior? Even though its a shared block you should be able to pass it a variable saying that you don't want it to add the icon.


(Also be careful when testing it, browsers are pretty aggressive in the icon caching and it may mess up your tests)


Regards,

João Rosado

Tiago Neves wrote:

You cannot remove a favicon, you must set it to something different. 

Are you referring to the site root /favicon.ico? I don't think there is one configured there, or if there is the server is configured to not serve it (HTTP 403).

Or are you talking about the link element with rel="shortcut icon" in the head? It seems there should be a way to have the code remove elements from the html before sending it.

Usually what happens is that you will have a favicon for the theme and maybe you use a different one for each Module (eSpace), use the Resources for this, or you use that AddFavicon if you want to set a special one for a page.

I believe this is pretty close to what I'm dealing with. I added a module/espace specific favicon as an image and then referenced it from an espace shared web block. The trouble is that web block is built on a site common web block that also sets the favicon and I'm not confident which one the browser takes, the first or the last. It would seem better to be able to remove the site-wide one when processing the page from the espace than to leave it up to chance or ordering.

I didn't put it in the Menu block but otherwise the steps on this page are pretty close to what I've done: https://success.outsystems.com/Documentation/Development_FAQs/How_to_set_a_favicon_tag

Thank you,

Jacob

João Rosado wrote:

Why don't you add some optional input to the blocks that you need to control the behavior? Even though its a shared block you should be able to pass it a variable saying that you don't want it to add the icon.

This is probably the best solution if there isn't a way to remove html or replace existing html instead of just inserting more html via HTTPRequestHandler. I was hoping for a module-specific override that didn't depend on coordination for places where it takes a while to get some modules updated.

(Also be careful when testing it, browsers are pretty aggressive in the icon caching and it may mess up your tests)

Good point, I might have already been caught by this in some of my testing. I'll double check with one of the online favicon testing services.

Thank you,

Jacob