How to disable support for webp images in Firefox?

0

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

Posted 2019-10-28T16:46:11.783

Reputation: 203

1Wouldn't something like "How to disable support for webp images in Firefox?" be a better title? (The "fallback" and "supported" parts are confusing, I feel.) Also, did you try to set a specific list of image formats in image.http.accept (probably also with some q to set your preferences), rather than just /? – Arjan – 2019-10-28T17:30:02.140

Can you give an example of a website that used to give images but now gives webp. – harrymc – 2019-10-28T17:35:46.443

@harrymc, for me google.com returns a few WebP images (at least when requested from Amsterdam).

– Arjan – 2019-10-29T17:44:16.707

Answers

1

"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

Posted 2019-10-28T16:46:11.783

Reputation: 29 084

1

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

Posted 2019-10-28T16:46:11.783

Reputation: 306 093

image.webp.enabled = false is ok, but the ideal would be that the webp image is displayed if no jpg is set in the picture tag. – Sly Mat – 2019-10-29T19:11:50.193

Then the title I proposed did not fully summarize the question, @SlyMat :-) – Arjan – 2019-10-29T20:00:14.277

See my addition at the end of the answer. – harrymc – 2019-10-29T20:10:54.730

Why would it be expected that image.http.accept = */* would/should not prefer the WebP image? Is that documented somewhere? (To me, that just tells the server that anything goes, but maybe WebP has some specific documented handling?) – Arjan – 2019-10-29T20:18:49.920

@Arjan: The syntax of "image/webp,*/*" says that webp is preferred, or anything else if unavailable. The syntax of "*/*" does not say that the browser supports webp, so the website cannot assume this support. – harrymc – 2019-10-29T20:22:39.893

Hmmm, unless a server should treat WebP differently from, say, PNG and JPEG, I'd say that */* just matches any type, hence including WebP? – Arjan – 2019-10-29T20:24:12.540

@Arjan: Yes it does, but webp is new and the client browser could predate it. – harrymc – 2019-10-29T20:39:47.033