updated tinycon lib

v1.18.x
Julian Lam 7 years ago
parent 3dd83237b8
commit 2123e2f74c

@ -3,7 +3,6 @@
* Tom Moor, http://tommoor.com * Tom Moor, http://tommoor.com
* Copyright (c) 2015 Tom Moor * Copyright (c) 2015 Tom Moor
* @license MIT Licensed * @license MIT Licensed
* @version 0.6.4
*/ */
(function(){ (function(){
@ -14,7 +13,8 @@
var faviconImage = null; var faviconImage = null;
var canvas = null; var canvas = null;
var options = {}; var options = {};
var r = window.devicePixelRatio || 1; // Chrome browsers with nonstandard zoom report fractional devicePixelRatio.
var r = Math.ceil(window.devicePixelRatio) || 1;
var size = 16 * r; var size = 16 * r;
var defaults = { var defaults = {
width: 7, width: 7,
@ -60,12 +60,11 @@
var removeFaviconTag = function(){ var removeFaviconTag = function(){
var links = document.getElementsByTagName('link'); var links = document.getElementsByTagName('link');
var head = document.getElementsByTagName('head')[0];
for(var i=0, len=links.length; i < len; i++) { for(var i=0, len=links.length; i < len; i++) {
var exists = (typeof(links[i]) !== 'undefined'); var exists = (typeof(links[i]) !== 'undefined');
if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/i)) { if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/i)) {
head.removeChild(links[i]); links[i].parentNode.removeChild(links[i]);
} }
} }
}; };

Loading…
Cancel
Save