Hi

For some obscure reason Firefox (32.0.3, Linux) doesn't show favicon in tab 
title in single-file mode when password is on. If there is no password set 
or if I use Chrome instead, everything works just fine.

I fixed it by adding two lines to *$:/core/modules/startup/favicon.js* but 
I have almost no experience in web-programming so I'm not even sure if I 
did it correctly or whether it's firefox bug or tiddlywiki's.

So here is modified *$:/core/modules/startup/favicon.js *:

/*\
title: $:/core/modules/startup/favicon.js
type: application/javascript
module-type: startup

Favicon handling

\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

// Export name and synchronous status
exports.name = "favicon";
exports.platforms = ["browser"];
exports.after = ["startup"];
exports.synchronous = true;
        
// Favicon tiddler
var FAVICON_TITLE = "$:/favicon.ico";

exports.startup = function() {
    // Set up the favicon
    setFavicon();
    // Reset the favicon when the tiddler changes
    $tw.wiki.addEventListener("change",function(changes) {
        if($tw.utils.hop(changes,FAVICON_TITLE)) {
            setFavicon();
        }
    });
};

function setFavicon() {
    var tiddler = $tw.wiki.getTiddler(FAVICON_TITLE);
    if(tiddler) {
        var faviconLink = document.getElementById("faviconLink");
        faviconLink.setAttribute("href","data:" + tiddler.fields.type + 
";base64," + tiddler.fields.text);
        // Hotfix for Firefox
        var docHead = document.getElementsByTagName('head')[0];
        docHead.appendChild(faviconLink);
    }
}

})();



-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to