mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-03-13 08:28:13 -04:00
Fall back to static icon on privacy.resistFingerprinting. Fix #1357.
This commit is contained in:
parent
1e6696bd70
commit
2c4c33c6b5
@ -57,10 +57,15 @@ drawIcon = (resultColor, profileColor) ->
|
|||||||
drawOmega drawContext, profileColor
|
drawOmega drawContext, profileColor
|
||||||
drawContext.setTransform(1, 0, 0, 1, 0, 0)
|
drawContext.setTransform(1, 0, 0, 1, 0, 0)
|
||||||
icon[size] = drawContext.getImageData(0, 0, size, size)
|
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
|
catch e
|
||||||
if not drawError?
|
if not drawError?
|
||||||
drawError = e
|
drawError = e
|
||||||
Log.error(e)
|
Log.error(e)
|
||||||
|
Log.error('Profile-colored icon disabled. Falling back to static icon.')
|
||||||
icon = null
|
icon = null
|
||||||
|
|
||||||
return iconCache[cacheKey] = icon
|
return iconCache[cacheKey] = icon
|
||||||
|
Loading…
Reference in New Issue
Block a user