mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Set the favicon href directly on Webkit browsers
We still delete and re-create the node on other browsers. Fixes #960. (imported from commit 3f0862793042c4a52d18104060ac2fe2ad21b3e6)
This commit is contained in:
@@ -17,12 +17,19 @@ exports.reset_favicon = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.set_favicon = function (url) {
|
exports.set_favicon = function (url) {
|
||||||
// I'm not sure whether setting the href attr on the existing
|
if ($.browser.webkit) {
|
||||||
// node would be sufficient. Notificon recreates the node.
|
// Works in Chrome 22 at least.
|
||||||
$(favicon_selector).remove();
|
// Doesn't work in Firefox 10.
|
||||||
$('head').append($('<link>')
|
$(favicon_selector).attr('href', url);
|
||||||
.attr('rel', 'shortcut icon')
|
} else {
|
||||||
.attr('href', url));
|
// 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($('<link>')
|
||||||
|
.attr('rel', 'shortcut icon')
|
||||||
|
.attr('href', url));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.make_loading_indicator = function (container, text) {
|
exports.make_loading_indicator = function (container, text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user