wingman-jr-addon / wingman_jr

This is the official repository (https://github.com/wingman-jr-addon/wingman_jr) for the Wingman Jr. Firefox addon, which filters NSFW images in the browser fully client-side: https://addons.mozilla.org/en-US/firefox/addon/wingman-jr-filter/ Optional DNS-blocking using Cloudflare's 1.1.1.1 for families! Also, check out the blog!
https://wingman-jr.blogspot.com/
Other
35 stars 6 forks source link

Some non-text/html pages don't load correctly #182

Closed wingman-jr-addon closed 1 year ago

wingman-jr-addon commented 1 year ago

Helpful user Drago reported that the page https://www.nokia.com/phones/de_at/support/api/pdf/nokia-5310-user-guide loads with symbols etc. Sounds like the bug with character set detection in the past.

wingman-jr-addon commented 1 year ago

(Found the old issue - see #70 )

wingman-jr-addon commented 1 year ago

Root cause was that a PDF was being served with no Content-Type, causing the addon to fallback to text/html instead of e.g. application/pdf. I do not know of a truly good solution, but I hacked at it by using the Content-Disposition filename's extension as a fallback to guess the Content-Type when not supplied if it is present. Yuck.