Skip to content

Commit

Permalink
Fix repeat loading of erroneous favicons. Fixes #212 (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston authored Oct 4, 2017
1 parent 23282ad commit 6c43a7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/images/defaultFavicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/js/viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const viz = {
this.collisionRadius = this.collisionRadius * this.scalingFactor;
this.scale = (window.devicePixelRatio || 1) * this.scalingFactor;
this.transform = d3.zoomIdentity;
this.defaultIcon = this.convertURIToImageData('images/defaultFavicon.svg');

this.updateCanvas(width, height);
this.draw(nodes, links);
Expand Down Expand Up @@ -204,6 +205,9 @@ const viz = {
context.drawImage(image, 0, 0, canvas.width, canvas.height);
return resolve(context.getImageData(0, 0, canvas.width, canvas.height));
};
image.onerror = () => {
return resolve(this.defaultIcon);
};
image.src = URI;
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Firefox Lightbeam",
"version": "2.0.2",
"version": "2.0.3",

"description": "Firefox Lightbeam is a Firefox browser extension that uses interactive visualizations to show you the relationships between third parties and the sites you visit.",
"homepage_url": "https://github.com/mozilla/lightbeam-we",
Expand Down

0 comments on commit 6c43a7c

Please sign in to comment.