From 0997c302aebaa1310feff35e8f42cab775960837 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 30 Aug 2026 09:49:09 +0200 Subject: [PATCH] fix(filebrowser_quantum): make Download save the file in the iOS companion app (#3030) * fix(filebrowser_quantum): make Download save the file in the iOS companion app FileBrowser downloads by clicking an that carries no download attribute and letting the attachment response do the rest. The Home Assistant iOS companion app is a WKWebView, where a download only happens when WebKit turns a navigation action into a WKDownload -- which is what the download attribute does, and the app hands the result to its own download manager (WebViewController+WebKitDelegates.swift, navigationAction:didBecome download:). Its response policy delegate returns .allow for every sub-frame and never returns .download, so inside the ingress panel a plain attachment navigation is simply rendered: a text file opens and shows its content with no way to save it. The ingress filter now adds the attribute, matched on the two exact download endpoints so nothing else in the app is touched. Desktop browsers already downloaded these and are unaffected, and an empty value keeps the filename the server sends in Content-Disposition. Co-Authored-By: Claude Opus 5 * fix(filebrowser_quantum): keep Open file a navigation, and narrow the claims Review of #3030 found that the 'no preview available' fallback renders an 'Open file' link on the same download endpoint with inline=true (views/files/Preview.vue), so a pathname-only match would have turned opening a file into downloading it. Exclude inline=true. Also narrows two overstated claims: the app's download manager is gated on iOS 17, and the public-share sidebar downloads with window.open() rather than an anchor, so it is not covered. Co-Authored-By: Claude Opus 5 --------- Co-authored-by: Claude Opus 5 --- filebrowser_quantum/CHANGELOG.md | 11 +++ filebrowser_quantum/config.yaml | 2 +- .../rootfs/etc/nginx/servers/ingress.conf | 69 +++++++++++++------ 3 files changed, 59 insertions(+), 23 deletions(-) diff --git a/filebrowser_quantum/CHANGELOG.md b/filebrowser_quantum/CHANGELOG.md index 2830d0b05a..dc4370c679 100644 --- a/filebrowser_quantum/CHANGELOG.md +++ b/filebrowser_quantum/CHANGELOG.md @@ -1,4 +1,15 @@ +## 1.5.3.2 (2026-08-30) +- Fix Download in the Home Assistant iOS companion app (iOS 17 and later), + where a file opened and showed its content with no way to save it. + FileBrowser downloads by clicking a link that carries no `download` + attribute, and the app's WKWebView only turns a click into a real download + when that attribute is present, so inside the ingress panel the file was + simply rendered. The ingress filter now adds the attribute to FileBrowser's + own download link. "Open file" still opens, and the public-share sidebar's + own download button is not covered. Desktop browsers already downloaded + these and are unchanged, as is direct access on port 8071. + ## 1.5.3.1 (2026-08-29) - Fix "open parent directory" in Tools -> File Size Analyzer under Home Assistant ingress. FileBrowser opened the parent folder in a new tab, which diff --git a/filebrowser_quantum/config.yaml b/filebrowser_quantum/config.yaml index 3b289e8d3c..11ab783109 100644 --- a/filebrowser_quantum/config.yaml +++ b/filebrowser_quantum/config.yaml @@ -118,4 +118,4 @@ schema: slug: filebrowser_quantum udev: true url: https://github.com/alexbelgium/hassio-addons -version: "1.5.3.1" +version: "1.5.3.2" diff --git a/filebrowser_quantum/rootfs/etc/nginx/servers/ingress.conf b/filebrowser_quantum/rootfs/etc/nginx/servers/ingress.conf index 119fe636f4..c884b54327 100644 --- a/filebrowser_quantum/rootfs/etc/nginx/servers/ingress.conf +++ b/filebrowser_quantum/rootfs/etc/nginx/servers/ingress.conf @@ -13,34 +13,59 @@ server { proxy_read_timeout 30m; proxy_pass %%protocol%%://backend%%subpath%%; - # Tools -> File Size Analyzer (and the other tool views) open a result's - # parent folder with window.open(, '_blank'), because - # goToItem() takes its newTab argument from the context menu's - # showLimitedOptions flag, which those views always set. Behind ingress - # that popup lands on the raw /api/hassio_ingress// url with no - # Home Assistant frontend around it to keep the ingress session alive, - # so the new tab answers 401 instead of showing the folder. Turn that - # popup into a navigation of the panel itself. + # Two things the ingress panel needs that a plain browser tab does not. + # Both are injected into the page's existing nonce-carrying inline script + # rather than next to
: FileBrowser sends + # script-src 'self' 'nonce-', so a standalone inline