Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…g policy error.
  • Loading branch information...
commit 525baac6ba489f8e1a8f225e1c6d4ded095defbf 1 parent e109f65
schnabear authored December 04, 2012

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. 10  notificon.js
10  notificon.js
@@ -82,7 +82,7 @@ or implied, of Matt Williams.
82 82
   };
83 83
 
84 84
   var getExistingFavicon = function getExistingFavicon() {
85  
-    var favicon = findFaviconTag();
  85
+    var favicon = findFaviconTag(false);
86 86
     return favicon ? favicon.getAttribute('href') : '/favicon.ico';
87 87
   };
88 88
 
@@ -137,6 +137,8 @@ or implied, of Matt Williams.
137 137
       return false;
138 138
     }
139 139
 
  140
+    removeNotificon();
  141
+
140 142
     var options = mergeDefaultOptions(myOptions);
141 143
 
142 144
     label = "" + label;
@@ -157,15 +159,15 @@ or implied, of Matt Williams.
157 159
       } catch(e) {
158 160
         if (console) {
159 161
           console.log('Notificon: cannot use icons located on a different domain (' + favicon + ')');
160  
-          return false;
161 162
         }
  163
+        return false;
162 164
       }
163 165
     };
164 166
     img.onerror = function() {
165 167
       if (console) {
166 168
         console.log('Notificon: image not found (' + options.favicon + ')');
167  
-        return false;
168 169
       }
  170
+      return false;
169 171
     };
170 172
     return true;
171 173
   };
@@ -183,4 +185,4 @@ or implied, of Matt Williams.
183 185
   } else {
184 186
     this.Notificon = Notificon;
185 187
   }
186  
-})(this);
  188
+})(this);

0 notes on commit 525baac

Please sign in to comment.
Something went wrong with that request. Please try again.