diff --git a/core/modules/startup.js b/core/modules/startup.js
index 2303b9849..9ea7e6685 100755
--- a/core/modules/startup.js
+++ b/core/modules/startup.js
@@ -112,6 +112,21 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tw-clear-password",function(event) {
$tw.crypto.setPassword(null);
});
+ // Set up the favicon
+ var faviconTitle = "$:/favicon.ico",
+ faviconLink = document.getElementById("faviconLink"),
+ setFavicon = function() {
+ var tiddler = $tw.wiki.getTiddler(faviconTitle);
+ if(tiddler) {
+ faviconLink.setAttribute("href","data:" + tiddler.fields.type + ";base64," + tiddler.fields.text);
+ }
+ };
+ setFavicon();
+ $tw.wiki.addEventListener("change",function(changes) {
+ if($tw.utils.hop(changes,faviconTitle)) {
+ setFavicon();
+ }
+ });
// Set up the styles
var styleTemplateTitle = "$:/core/ui/PageStylesheet",
styleParser = $tw.wiki.parseTiddler(styleTemplateTitle);
diff --git a/core/templates/tiddlywiki5.html.tid b/core/templates/tiddlywiki5.html.tid
index 981de1614..e2929361e 100644
--- a/core/templates/tiddlywiki5.html.tid
+++ b/core/templates/tiddlywiki5.html.tid
@@ -14,7 +14,7 @@ title: $:/core/templates/tiddlywiki5.html
-
+
{{$:/core/wiki/title}}
diff --git a/editions/tw5.com/tiddlers/Release 5.0.5beta.tid b/editions/tw5.com/tiddlers/Release 5.0.5beta.tid
index 3fec0f180..a62f26355 100644
--- a/editions/tw5.com/tiddlers/Release 5.0.5beta.tid
+++ b/editions/tw5.com/tiddlers/Release 5.0.5beta.tid
@@ -8,7 +8,7 @@ type: text/vnd.tiddlywiki
!! Improvements
-*
+* Added support for [[Setting a favicon]]
!! Bug Fixes
diff --git a/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid b/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid
new file mode 100644
index 000000000..c9bcdf543
--- /dev/null
+++ b/editions/tw5.com/tiddlers/howtos/Setting a favicon.tid
@@ -0,0 +1,17 @@
+created: 20131224074240979
+modified: 20131224075348329
+tags: howto
+title: Setting a favicon
+type: text/vnd.tiddlywiki
+
+"favicons" are small icons that most browsers display to help users identify websites.
+
+! favicons in the Browser
+
+When TiddlyWiki starts up in the browser it looks for a tiddler called [[$:/favicon.ico]] and dynamically uses it as the favicon for the page. If you modify the image then the favicon changes instantly to reflect it.
+
+! favicons on the Server
+
+On the server, the ServerCommand will serve the tiddler [[$:/favicon.ico]] at the path `/favicon.ico`.
+
+