Reset favicon after setting window.location.hash

Firefox drops the favicon after modifying window.location.hash, so we
reset it after modifying it.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=408415 and
https://bugzilla.mozilla.org/show_bug.cgi?id=519028

This fixes #422

(imported from commit 3d7ac5ba28a4fa94d2bd9a0f711db8cd538039d3)
This commit is contained in:
Zev Benjamin 2012-12-17 16:55:10 -05:00
parent 989cee3194
commit a92a35906c
2 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,7 @@ function preserve_compose(send_after_reload) {
$(function () {
var location = window.location.toString();
window.location.hash = '';
util.reset_favicon();
var fragment = location.substring(location.indexOf('#') + 1);
if (fragment.search("reload:") !== 0) {
return;

View File

@ -7,5 +7,12 @@ exports.random_int = function random_int(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
// We need to reset the favicon after changing the
// window.location.hash or Firefox will drop the favicon. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=519028
exports.reset_favicon = function () {
$('link[rel="shortcut icon"]').detach().appendTo('head');
};
return exports;
}());