Skip to content

Commit

Permalink
setting favicon.ico dinamically
Browse files Browse the repository at this point in the history
Signed-off-by: jberny <f.bernardi89@gmail.com>
  • Loading branch information
Sprootsy committed Oct 11, 2020
1 parent a8ed0d5 commit 2c000b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ui/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Alertmanager</title>
<script>
// Make sure that the favicon can be retrieved also when
// --web.external-url is not default
favicon = document.querySelector("link[rel*='icon']") || document.createElement('link');
favicon.rel = 'icon';
favicon.type = 'image/x-icon';
favicon.href = (location.pathname + '/favicon.ico').replace(/[/][/]/g, "/");
document.head.appendChild(favicon);
console.log('added favicon');
</script>
</head>
<body>
<script>
Expand Down

0 comments on commit 2c000b2

Please sign in to comment.