From c94d3a59dec09a4a16ee0a749beaa42a98f1d5d8 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 20 May 2014 15:24:39 -0400 Subject: [PATCH] Update favico.js fix empty url issue (for localhost), and when using 'data:' --- favico.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/favico.js b/favico.js index edff688..0bfffe6 100644 --- a/favico.js +++ b/favico.js @@ -479,7 +479,7 @@ } //check if image and link url is on same domain. if not raise error url = (_opt.elementId) ? elm.src : elm.href; - if (url.indexOf(document.location.hostname) === -1) { + if (url && url.substr(0, 5) !== 'data:' && url.indexOf(document.location.hostname) === -1) { throw new Error('Error setting favicon. Favicon image is on different domain (Icon: ' + url + ', Domain: ' + document.location.hostname + ')'); } elm.setAttribute('type', 'image/png');