mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-07 14:10:28 +03:00
Find favicon once
This commit is contained in:
parent
3133431fff
commit
58c19f1c4d
@ -132,11 +132,16 @@ window.addEventListener("message", function(event) {
|
||||
});
|
||||
|
||||
var getFavicon = function() {
|
||||
if (document.favicon) {
|
||||
return document.favicon;
|
||||
}
|
||||
|
||||
var nodeList = document.getElementsByTagName("link");
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
if ((nodeList[i].getAttribute("rel") == "apple-touch-icon") || (nodeList[i].getAttribute("rel") == "icon") || (nodeList[i].getAttribute("rel") == "shortcut icon")) {
|
||||
const favicon = nodeList[i].getAttribute("href");
|
||||
if (!favicon.endsWith("svg")) {
|
||||
document.favicon = favicon;
|
||||
return favicon;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user