mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-08 14:49:38 +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() {
|
var getFavicon = function() {
|
||||||
|
if (document.favicon) {
|
||||||
|
return document.favicon;
|
||||||
|
}
|
||||||
|
|
||||||
var nodeList = document.getElementsByTagName("link");
|
var nodeList = document.getElementsByTagName("link");
|
||||||
for (var i = 0; i < nodeList.length; i++) {
|
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")) {
|
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");
|
const favicon = nodeList[i].getAttribute("href");
|
||||||
if (!favicon.endsWith("svg")) {
|
if (!favicon.endsWith("svg")) {
|
||||||
|
document.favicon = favicon;
|
||||||
return favicon;
|
return favicon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user