Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

favicon: Invalidate favicon_state.image without a network request.

Anders Kaseorg954ad9f7abb2
diff --git a/static/js/favicon.js b/static/js/favicon.js
index 02a13cc621e..d97104ef745 100644
--- a/static/js/favicon.js
+++ b/static/js/favicon.js
@@ -11,7 +11,13 @@ function set_favicon() {
export function update_favicon(new_message_count, pm_count) {
if (favicon_state !== undefined) {
favicon_state.image.removeEventListener("load", set_favicon);
- favicon_state.image.src = "#";
+
+ // We need to remove this src so revokeObjectURL doesn't cause a
+ // net::ERR_FILE_NOT_FOUND error in Chrome. This seems to be the
+ // simplest way to do that without triggering an expensive network
+ // request or spewing a different console error.
+ favicon_state.image.src = "data:,";
+
URL.revokeObjectURL(favicon_state.url);
favicon_state = undefined;
}