diff --git a/core.js b/core.js index e349edea..73f6a7b3 100644 --- a/core.js +++ b/core.js @@ -519,6 +519,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 59101399..8dced6ed 100644 --- a/package.json +++ b/package.json @@ -233,7 +233,8 @@ "docm", "dotm", "potm", - "pptm" + "pptm", + "jar" ], "dependencies": { "@tokenizer/inflate": "^0.2.6", diff --git a/readme.md b/readme.md index 9cb86064..5c22f3f9 100644 --- a/readme.md +++ b/readme.md @@ -484,6 +484,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 ed98dac6..54d6dcd3 100644 --- a/supported.js +++ b/supported.js @@ -170,6 +170,7 @@ export const extensions = [ 'dotm', 'potm', 'pptm', + 'jar', ]; export const mimeTypes = [ @@ -339,4 +340,5 @@ export const mimeTypes = [ 'application/vnd.ms-word.template.macroEnabled.12', 'application/vnd.ms-powerpoint.template.macroEnabled.12', 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'application/java-archive', ];