Forcing Firefox to Open CBZ Files Properly

If you’ve ever downloaded a .cbz file using Firefox and then tried to click it in the downloads panel, you might have noticed that Firefox ignores the association for the .cbz extension and instead opens it as a .zip file. (This isn’t the only situation where this happens and I filed a bug about it a year ago.)

I never got around to looking into why it doesn’t make the same mistake with .odt documents, which are also Zip files with a specialized extension, but I think you can see why I wouldn’t like it.

Here’s a quick little script that can be set as the Zip handler on a KDE-based desktop which will hand over to Ark under normal circumstances but, if it receives a file with a .cbz extension, will pop up a Yes/No dialog offering to open in Comix instead.

Anything which obeys the system’s associations properly will never trigger it, because .cbz files will be associated with Comix and it won’t pop up the dialog if fed a .zip file, so it’s about the best solution one can have without fixing Firefox.

This approach could also be easily extended to application/octet-stream to work around the other situation where I’ve seen this causing problems. (Patreon serving up image files with the wrong mimetype, if I remember correctly.)

CC BY-SA 4.0 Forcing Firefox to Open CBZ Files Properly by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This entry was posted in Geek Stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.

All comments are moderated. If your comment is generic enough to apply to any post, it will be assumed to be spam. Borderline comments will have their URL field erased before being approved.