Permalink
Browse files

Fixed resetting of favicon that causes a Cross-Origin Resource Sharin…

…g policy error.
  • Loading branch information...
1 parent e109f65 commit 525baac6ba489f8e1a8f225e1c6d4ded095defbf @schnabear schnabear committed Dec 4, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 notificon.js
View
@@ -82,7 +82,7 @@ or implied, of Matt Williams.
};
var getExistingFavicon = function getExistingFavicon() {
- var favicon = findFaviconTag();
+ var favicon = findFaviconTag(false);
return favicon ? favicon.getAttribute('href') : '/favicon.ico';
};
@@ -137,6 +137,8 @@ or implied, of Matt Williams.
return false;
}
+ removeNotificon();
+
var options = mergeDefaultOptions(myOptions);
label = "" + label;
@@ -157,15 +159,15 @@ or implied, of Matt Williams.
} catch(e) {
if (console) {
console.log('Notificon: cannot use icons located on a different domain (' + favicon + ')');
- return false;
}
+ return false;
}
};
img.onerror = function() {
if (console) {
console.log('Notificon: image not found (' + options.favicon + ')');
- return false;
}
+ return false;
};
return true;
};
@@ -183,4 +185,4 @@ or implied, of Matt Williams.
} else {
this.Notificon = Notificon;
}
-})(this);
+})(this);

0 comments on commit 525baac

Please sign in to comment.