dont-accept-webp
dont-accept-webp copied to clipboard
Not working on at least one site
I ran into this image on PlayStation's website that sends as a WEBP: https://gmedia.playstation.com/is/image/SIEPDC/updated-map-of-valisthea?$3200px$
Even with this extension installed and enabled, with no other extensions enabled, and no exemption applied, that image still renders as a WEBP.
Looking at the extension's reviews on the Firefox add-on store, a test image is presented: https://i2.wp.com/radical-mag.com/wp-content/uploads/2019/08/@Test-BMW-320d-8.jpg However, this URL does not actually work. I get an error saying "Sorry, the parameters you provided were not valid"
Thank you for your report.
On the PlayStation site, the server apparently doesn't care about the Accept header.
In this case, I can get a native JPEG file if I say my browser is an old version of Internet Explorer. However, this add-on is very basic and doesn't have method to check whether Firefox still received a WebP image and try an alternate strategy.
For sites like this one, you could use one of my other extensions (listed below) that have a button to re-request the image masquerading as IE11. Or you might be able to use a user agent switcher add-on (although it may affect web pages and not just images).
On the test image, I'm not sure why you get an error. Does it look like the URL is being modified? Do you use any add-ons that may strip or modify other request headers?
My extensions for saving WebP images when the basic workaround doesn't avoid loading them:
I know, I should merge them all together into one tool, but... there are just too many other things going on.
The test image loaded on my phone, so maybe there's something else like my VPN in the way on desktop. I'll check further.
On the PlayStation site, the server apparently doesn't care about the Accept header.
This is becoming the case for more sites, then. I've noticed this extension not helping a few times before this, so it looks like more and more servers are ignoring these headers.
this add-on is very basic and doesn't have method to check whether Firefox still received a WebP image and try an alternate strategy.
Then shouldn't it be improved to do so? I can indeed receive a JPG image if I open the link in Edge and refresh it in IE11 mode, and sure I can install yet another extension to do this in Firefox, but can't we automate that in a single extension? It wouldn't have to be this one, it can be whichever one has the most downloads, but still, it would make this a lot easier.
I've noticed that the extension also doesn't work on NexusMods anymore. Every screenshot there, even the ones with .png in their url, are saved as WebPs now.
Apparently you have to change the User-Agent
header to almost anything:
(Steps: Open Web Inspector's Network panel, (re)load the image, click on the image's url there, at the right click the Resend button, the left panel opens up, changed the User-Agent
to anything (but don't uncheck it), then click Send at the left bottom.)
Interestingly, it reports that content-length: 3 094 675
, yet the actual jpeg downloaded (by right-clicking on the newly loaded row and choosing Save Image As, or copying as a data url and saving that) results only the first MiB (1048576 = 1024*1024 bytes), resulting a broken progressive jpeg.
Aha, they are serving WebP based on modern browser identification. That is why requesting the file as Internet Explorer 11 or as "foo" retrieves the original JPEG media.
One of the challenges is that changing your user agent string can affect other aspects of the site. It would be ideal to only change it for image requests, but it's difficult to identify that the example URL is retrieving an image (especially when viewed "stand alone" in a new tab where it isn't called by an inline image tag).
Since users typically only care about WebP when saving, I always want to find a solution that avoids too much breakage the other 99% of the time. That probably means adding a new right-click context menu item that builds in tricks such as using a different user agent for the request.