Skip to content

Commit

Permalink
Fall back to static icon on privacy.resistFingerprinting. Fix #1357.
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisCatus committed Jan 28, 2018
1 parent 1e6696b commit 2c4c33c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions omega-target-chromium-extension/src/coffee/background.coffee
Expand Up @@ -57,10 +57,15 @@ drawIcon = (resultColor, profileColor) ->
drawOmega drawContext, profileColor
drawContext.setTransform(1, 0, 0, 1, 0, 0)
icon[size] = drawContext.getImageData(0, 0, size, size)
if icon[size].data[3] == 255
# Some browsers may replace the image data with a opaque white image to
# resist fingerprinting. In that case the icon cannot be drawn.
throw new Error('Icon drawing blocked by privacy.resistFingerprinting.')
catch e
if not drawError?
drawError = e
Log.error(e)
Log.error('Profile-colored icon disabled. Falling back to static icon.')
icon = null

return iconCache[cacheKey] = icon
Expand Down

0 comments on commit 2c4c33c

Please sign in to comment.