diff --git a/frontend_tests/node_tests/hashchange.js b/frontend_tests/node_tests/hashchange.js index 4fd80414cb..95e710ca63 100644 --- a/frontend_tests/node_tests/hashchange.js +++ b/frontend_tests/node_tests/hashchange.js @@ -123,7 +123,6 @@ function test_helper() { stub('admin', 'launch'); stub('drafts', 'launch'); - stub('favicon', 'reset'); stub('floating_recipient_bar', 'update'); stub('message_viewport', 'stop_auto_scrolling'); stub('narrow', 'deactivate'); @@ -301,7 +300,6 @@ run_test('save_narrow', () => { helper.assert_events([ 'message_viewport.stop_auto_scrolling', - 'favicon.reset', ]); assert.equal(window.location.hash, '#narrow/is/private'); @@ -318,7 +316,6 @@ run_test('save_narrow', () => { hashchange.save_narrow(operators); helper.assert_events([ 'message_viewport.stop_auto_scrolling', - 'favicon.reset', ]); assert.equal(url_pushed, 'http://example.com/#narrow/is/starred'); }); diff --git a/static/js/favicon.js b/static/js/favicon.js index 105e8b282e..527c090d3f 100644 --- a/static/js/favicon.js +++ b/static/js/favicon.js @@ -1,26 +1,5 @@ -const favicon_selector = 'link[rel="shortcut icon"]'; - -// 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 = function () { - $(favicon_selector).detach().appendTo('head'); -}; - exports.set = function (url) { - if (/webkit/i.test(navigator.userAgent)) { - // Works in Chrome 22 at least. - // Doesn't work in Firefox 10. - $(favicon_selector).attr('href', url); - } else { - // Delete and re-create the node. - // May cause excessive work by the browser - // in re-rendering the page (see #882). - $(favicon_selector).remove(); - $('head').append($('') - .attr('rel', 'shortcut icon') - .attr('href', url)); - } + $('#favicon').attr('href', url); }; diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 8014fcf670..e546ffc89b 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -38,7 +38,6 @@ exports.changehash = function (newhash) { } message_viewport.stop_auto_scrolling(); set_hash(newhash); - favicon.reset(); }; exports.save_narrow = function (operators) { diff --git a/templates/zerver/base.html b/templates/zerver/base.html index d043093720..46b0613bbd 100644 --- a/templates/zerver/base.html +++ b/templates/zerver/base.html @@ -12,7 +12,7 @@ Zulip {% endif %} {% endblock %} - + {% block meta_viewport %} {% endblock %}