Skip to content

Commit 4ddba86

Browse files
committed
Extend JPEG XL detection/recognition from Waterfox
1 parent f6c1d4f commit 4ddba86

File tree

11 files changed

+14
-4
lines changed

11 files changed

+14
-4
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ webext-storage = { git = "https://github.com/mozilla/application-services", rev
219219
# Patch mio 0.8.8 to use windows-sys 0.52 (backport https://github.com/tokio-rs/mio/commit/eea9e3e0c469480e5c59c01e6c3c7e5fd88f0848)
220220
mio_0_8 = { package = "mio", git = "https://github.com/glandium/mio", rev = "9a2ef335c366044ffe73b1c4acabe50a1daefe05" }
221221

222+
# add unmerged mime types
223+
mime_guess = { path = "third_party/rust/mime_guess" }
224+
222225
# Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
223226
# There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
224227
[patch.crates-io.mio]

browser/components/BrowserContentHandler.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,7 @@ function maybeRecordToHandleTelemetry(uri, isLaunch) {
11941194
".xhtml",
11951195
".svg",
11961196
".webp",
1197+
".jxl",
11971198
]);
11981199
if (registeredExtensions.has(extension)) {
11991200
Services.telemetry.keyedScalarAdd(scalar, extension, 1);

browser/installer/windows/msix/AppxManifest.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<uap:FileType>.xhtml</uap:FileType>
6767
<uap:FileType>.svg</uap:FileType>
6868
<uap:FileType>.webp</uap:FileType>
69+
<uap:FileType>.jxl</uap:FileType>
6970
</uap:SupportedFileTypes>
7071
<uap:Logo>Assets\Document44x44.png</uap:Logo>
7172
<uap2:SupportedVerbs>

browser/installer/windows/nsis/shared.nsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ ${RemoveDefaultBrowserAgentShortcut}
544544
${AddAssociationIfNoneExist} ".svg" "FirefoxHTML$5"
545545
${AddAssociationIfNoneExist} ".webp" "FirefoxHTML$5"
546546
${AddAssociationIfNoneExist} ".avif" "FirefoxHTML$5"
547+
${AddAssociationIfNoneExist} ".jxl" "WaterfoxHTML$5"
547548

548549
${AddAssociationIfNoneExist} ".pdf" "FirefoxPDF$5"
549550

browser/installer/windows/nsis/uninstaller.nsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ Section "Uninstall"
486486
${un.RegCleanFileHandler} ".svg" "FirefoxHTML-$AppUserModelID"
487487
${un.RegCleanFileHandler} ".webp" "FirefoxHTML-$AppUserModelID"
488488
${un.RegCleanFileHandler} ".avif" "FirefoxHTML-$AppUserModelID"
489+
${un.RegCleanFileHandler} ".jxl" "WaterfoxHTML-$AppUserModelID"
489490

490491
${un.RegCleanFileHandler} ".pdf" "FirefoxPDF-$AppUserModelID"
491492

third_party/rust/mime_guess/src/mime_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[
567567
("jsonml", &["application/jsonml+json"]),
568568
("jsx", &["text/jscript"]),
569569
("jsxbin", &["text/plain"]),
570+
("jxl", &["image/jxl"]),
570571
("kar", &["audio/midi"]),
571572
("karbon", &["application/vnd.kde.karbon"]),
572573
("kfo", &["application/vnd.kde.kformula"]),

toolkit/components/downloads/DownloadList.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const FILE_EXTENSIONS = [
5050
"jpg",
5151
"jpeg",
5252
"json",
53+
"jxl",
5354
"m4a",
5455
"mdb",
5556
"mid",

toolkit/components/extensions/parent/ext-downloads.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ const FILTER_IMAGES_EXTENSIONS = [
104104
"raw",
105105
"webp",
106106
"heic",
107+
"avif",
108+
"jxl",
107109
];
108110

109111
const FILTER_XML_EXTENSIONS = ["xml"];

toolkit/content/filepicker.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
allFilter=*
66
htmlFilter=*.html; *.htm; *.shtml; *.xhtml
77
textFilter=*.txt; *.text
8-
imageFilter=*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp; *.ico; *.svg; *.svgz; *.tif; *.tiff; *.ai; *.drw; *.pct; *.psp; *.xcf; *.psd; *.raw; *.webp; *.heic
8+
imageFilter=*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp; *.ico; *.svg; *.svgz; *.tif; *.tiff; *.ai; *.drw; *.pct; *.psp; *.xcf; *.psd; *.raw; *.webp; *.heic; *.avif; *.jxl
99
xmlFilter=*.xml
1010
xulFilter=*.xul
1111
audioFilter=*.aac; *.aif; *.flac; *.iff; *.m4a; *.m4b; *.mid; *.midi; *.mp3; *.mpa; *.mpc; *.oga; *.ogg; *.opus; *.ra; *.ram; *.snd; *.wav; *.wma

widget/gtk/nsAppShell.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ nsresult nsAppShell::Init() {
419419
gchar* name = gdk_pixbuf_format_get_name(format);
420420
if (strcmp(name, "jpeg") && strcmp(name, "png") && strcmp(name, "gif") &&
421421
strcmp(name, "bmp") && strcmp(name, "ico") && strcmp(name, "xpm") &&
422-
strcmp(name, "svg") && strcmp(name, "webp") && strcmp(name, "avif")) {
422+
strcmp(name, "svg") && strcmp(name, "webp") && strcmp(name, "avif") &&
423+
strcmp(name, "jxl")) {
423424
gdk_pixbuf_format_set_disabled(format, TRUE);
424425
}
425426
g_free(name);

0 commit comments

Comments
 (0)