From 4c07b426bd1131be98daecab2a868b1ca28e46a6 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Sat, 26 Aug 2023 16:05:14 -0700 Subject: [PATCH] Delete favicon.min.js --- favicon.min.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 favicon.min.js diff --git a/favicon.min.js b/favicon.min.js deleted file mode 100644 index a014737..0000000 --- a/favicon.min.js +++ /dev/null @@ -1 +0,0 @@ -async function favicon(a,b){function c(a){return new Promise(function(b,c){var d,e=new Image;e.onerror=e.onabort=function(){clearTimeout(d),c("error")},e.onload=function(){clearTimeout(d),b("success")},d=setTimeout(function(){e.src="//!!!!/test.jpg",c("timeout")},5000),e.src=a})}const d=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;if(null==a||""==a)throw new Error("No icon provided!");var e=b?b:d.test(a)?"base64":"png";var f="ico"==e?"image/x-icon":"image/gif";var g=document.querySelector("link[rel~='icon']");if(g||(g=document.createElement("link"),g.rel="shortcut icon",g.type=f,document.getElementsByTagName("head")[0].appendChild(g)),"base64"!=e){var h=c(a);h.then(function(b){if("success"==b){if(g.href=a,g.href==a)console.log(`Image: ${a}, Set successfully!`);else throw new Error("Favicon was not set!");}else if("timeout"==b)throw new Error(`Image timedout: favicon was not set!`)},function(){throw new Error(`Invalid image: favicon was not set!`)})}else if(d.test(a))if(g.href=a,g.href==a)console.log(`favicon.js: favicon Set successfully!`);else throw new Error("Favicon was not set!")} \ No newline at end of file