Skip to content

Commit 4438478

Browse files
Add firefox for fallback as well
1 parent 0f0b801 commit 4438478

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/script.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ function needsFallback() {
173173
const isAppleDevice = /MacIntel|iPhone|iPad|iPod/i.test(platform);
174174
const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
175175

176-
return isAppleDevice || isSafari;
176+
const isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
177+
178+
return isAppleDevice || isSafari || isFirefox;
177179
}
178180

179181
function handleFallbackSetup() {
@@ -184,7 +186,7 @@ function handleFallbackSetup() {
184186

185187
const p = document.createElement("p");
186188
p.innerHTML =
187-
"If you are using an Apple Device, the blue border may not show up on the image. <br> " +
189+
"If you are using an Apple Device or Firefox, the image not be generated properly. <br> " +
188190
"You can click the 'Generate fallback' button below to get the server generated image. <br> " +
189191
"Note that it can take a couple of seconds to load. <br>" +
190192
"<strong> This is a limited, temporary fix. Size has no effect.</strong>";

0 commit comments

Comments
 (0)