diff --git a/core.js b/core.js index 8794e7cd..2bc4d669 100644 --- a/core.js +++ b/core.js @@ -494,6 +494,14 @@ export class FileTypeParser { return { stop: true, }; + case 'META-INF/MANIFEST.MF': + fileType = { + ext: 'jar', + mime: 'application/java-archive', + }; + return { + stop: true, + }; case 'mimetype': return { async handler(fileData) { diff --git a/fixture/fixture.jar b/fixture/fixture.jar new file mode 100644 index 00000000..948b2ea5 Binary files /dev/null and b/fixture/fixture.jar differ diff --git a/package.json b/package.json index 293532e4..4d4d3043 100644 --- a/package.json +++ b/package.json @@ -228,7 +228,8 @@ "odg", "otg", "otp", - "ott" + "ott", + "jar" ], "dependencies": { "@tokenizer/inflate": "^0.2.6", diff --git a/readme.md b/readme.md index 1a8526e1..cfe16408 100644 --- a/readme.md +++ b/readme.md @@ -482,6 +482,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream. - [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document - [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker - [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000 +- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive - [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images - [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000 - [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image diff --git a/supported.js b/supported.js index d2b296f1..a58a5b84 100644 --- a/supported.js +++ b/supported.js @@ -165,6 +165,7 @@ export const extensions = [ 'otp', 'odg', 'otg', + 'jar', ]; export const mimeTypes = [ @@ -329,4 +330,5 @@ export const mimeTypes = [ 'application/vnd.oasis.opendocument.presentation-template', 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', + 'application/java-archive', ];