Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We just ran into this issue at @vimeo. We load our favicon off of a cdn.
The source is http://f.vimeocdn.com/images_v6/favicon_32.ico
We noticed we were getting a bunch of CORS errors because we do not have access control headers set up for this cdn domain. I was going to add them, but then it occured to me that they shouldn't be needed.
Unless I'm missing something, it looks to me like each time you call to update the favicon to a specific percentage you first create a new Image() with the source of the currentFavicon and wait for it to load. This is a lot of extra requests that are not necessary to just write a data uri out to the page, but it also means that it won't work if your favicon is hosted on a separate domain.
You can reproduce the issue by setting the source on your example/index.html page to the url I provided.
This pull request removes all the image preloading so it should also cut down on requests and speed things up.