Skip to content

Commit

Permalink
Do not assume <link> tags are children of <head>
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdplm committed Mar 20, 2017
1 parent f018785 commit 7e8b207
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tinycon.js
Expand Up @@ -62,12 +62,11 @@
var removeFaviconTag = function(){

var links = document.getElementsByTagName('link');
var head = document.getElementsByTagName('head')[0];

for(var i=0, len=links.length; i < len; i++) {
var exists = (typeof(links[i]) !== 'undefined');
if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/i)) {
head.removeChild(links[i]);
links[i].parentNode.removeChild(links[i]);
}
}
};
Expand Down

0 comments on commit 7e8b207

Please sign in to comment.