From bf6735420d2f8191f658c556910e7d73c681d5fe Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sun, 10 May 2020 11:58:40 +0100 Subject: [PATCH] Fix SVG favicons --- core/modules/startup/favicon.js | 6 +----- editions/tw5.com/tiddlers/howtos/Setting a favicon.tid | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/modules/startup/favicon.js b/core/modules/startup/favicon.js index 5adcec646..0e730905f 100644 --- a/core/modules/startup/favicon.js +++ b/core/modules/startup/favicon.js @@ -36,11 +36,7 @@ function setFavicon() { var tiddler = $tw.wiki.getTiddler(FAVICON_TITLE); if(tiddler) { var faviconLink = document.getElementById("faviconLink"); - if(tiddler.fields._canonical_uri) { - faviconLink.setAttribute("href",tiddler.fields._canonical_uri); - } else { - faviconLink.setAttribute("href","data:" + tiddler.fields.type + ";base64," + tiddler.fields.text); - } + faviconLink.setAttribute("href",$tw.utils.makeDataUri(tiddler.fields.text,tiddler.fields.type,tiddler.fields._canonical_uri)); } } diff --git a/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid b/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid index a18dbfd55..6e707656c 100644 --- a/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid +++ b/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid @@ -1,10 +1,10 @@ created: 20131224074240979 -modified: 20200422163752597 +modified: 20200510115704738 tags: [[Customise TiddlyWiki]] title: Setting a favicon type: text/vnd.tiddlywiki -"favicons" are small icons that most browsers display to help users identify websites. +"favicons" are small icons that most browsers display to help users identify websites. Note that all browsers support bitmap images, but only certain modern browsers support SVG format icons. ! favicons in the Browser