
Loading…
More image types for transposeType #495
lewisje
commented
gorhill
commented
why
Because there are no known issues?
gorhill
commented
Not an issue. The code for image/css/other was put there to deal with a Chromium bug. The guessing of image/css types can now be removed as the bug was solved for these types.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was browsing the source code and found this line in the function
transposeType: https://github.com/gorhill/uBlock/blob/master/src/js/ublock.js#L294if ( '.ico.png.gif.jpg.jpeg.'.indexOf(ext) !== -1 ) {This line is meant to suss out whether a request treated by the webRequest API as
otheris actually an image, but why aren'tbmpandwebpin that string? I realize the former is old and should never be used in Web design, but browsers do understand it, and although the latter does not have wide support, I know that some sites actually send WebP images to browsers that support the format.Also, a few lines up, why can't the function also transpose request types that are detected as
object(like those requests thatnsIContentPolicyon Firefox would detect asobjectsubrequest) and yet are actually images or fonts (which the function already changes tostylesheetif they were originallyother)?