fix: remove firefox UA sniff for img.decode (#1393)

fixes #1388
pull/1398/head
Nolan Lawson 2019-08-17 15:35:43 -07:00 zatwierdzone przez GitHub
rodzic f25c93526c
commit 03dff1c595
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 6 usunięć

Wyświetl plik

@ -1,10 +1,5 @@
const IS_FIREFOX = process.browser && /Firefox/.test(navigator.userAgent)
export function decodeImage (img) {
// Remove this UA sniff when the Firefox bug is fixed
// https://github.com/nolanlawson/pinafore/issues/1344#issuecomment-514312672
// https://bugzilla.mozilla.org/show_bug.cgi?id=1565542
if (!IS_FIREFOX && typeof img.decode === 'function' && !img.src.startsWith('data:image/png;base64,')) {
if (typeof img.decode === 'function' && !img.src.startsWith('data:image/png;base64,')) {
return img.decode()
}