10

Since Firefox is natively supporting .webp images, they are displayed as webp images on web sites providing this option. How can we globally force Firefox to always fallback to jpg or png images?

I know .webp images support is an improvement, but for my case I need to export a lot of pictures from websites using a drag'n drop from Firefox to Windows Explorer. As webp images are not supported natively by Windows, this is useless... I would like to get the standard image instead.

Remark: Before Firefox v70, it was possible to force it in tweaking about:config : "image.http.accept" = "image/webp,*/*" > change to "*/*" But this tweak is not working anymore.

Sly Mat
  • 572

2 Answers2

5

"image.http.accept" = "image/webp,*/*" > change to "*/*"

This change would still leave it up to the server to make a choice for the best format, including formats you don't like and formats that the browser does not even support.

Instead, for your use case you'd better set specific preferences, including quality values:

Quality values, or q-values and q-factors, are used to describe the order of priority of values in a comma-separated list. It is a special syntax allowed in some HTTP headers and in HTML. The importance of a value is marked by the suffix ';q=' immediately followed by a value between 0 and 1 included, with up to three decimal digits, the highest value denoting the highest priority. When not present, the default value is 1.

So, something like:

  • image/png,image/*;q=0.8,*/*;q=0.5 (which was used up to Firefox 46)
  • or more specific with a low quality value for WebP: image/webp;0.1,image/png;q=0.9,image/jpeg;q=0.8,image/*;q=0.7,*/*;q=0.6

(I've not tested this. Maybe servers only use WebP when explicitly allowed by the browser.)

Arjan
  • 31,511
4

I have created a test case HTML that looks like:

<!doctype html>
<html>
<picture>
  <source srcset="pic.webp" type="image/webp">
  <source srcset="pic.jpg" type="image/jpeg"> 
  <img src="pic.jpg" type="image/jpeg"> 
</picture>
</html>

With this test I was able to test when Firefox does return a JPG image and when a WEBP image.

  • image.http.accept = */*
    This was not enough - the image that is displayed is the .webp variant. In fact, this setting had no effect in any way.

  • image.webp.enabled = false
    This setting caused Firefox to display the .jpg. It was enough by itself.

Note: The tests were done using Firefox v70. I consider setting image.webp.enabled to be a temporary workaround, and the problem with image.http.accept to be a bug.

I would suggest reporting the bug to the Firefox developers, and I'm sure/hope that this will be fixed in a future version.

harrymc
  • 498,455