From 03dff1c595ccb10fd9f08267a3df1d40b50e3f20 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 17 Aug 2019 15:35:43 -0700 Subject: [PATCH] fix: remove firefox UA sniff for img.decode (#1393) fixes #1388 --- src/routes/_utils/decodeImage.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/routes/_utils/decodeImage.js b/src/routes/_utils/decodeImage.js index 9e8d30d1..de145189 100644 --- a/src/routes/_utils/decodeImage.js +++ b/src/routes/_utils/decodeImage.js @@ -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() }