revert(filebrowser_quantum): drop the ingress window.open filter pending download report

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
alexbelgium
2026-08-30 08:18:20 +02:00
parent 331af4bcc9
commit 1d86e79dce
3 changed files with 7 additions and 31 deletions

View File

@@ -1,4 +1,9 @@
## 1.5.3.2 (2026-08-30)
- Revert the 1.5.3.1 ingress filter while a report of broken downloads is
investigated. "Open parent directory" in the tool views opens a new tab
again, as it did up to 1.5.3.
## 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

View File

@@ -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"

View File

@@ -3,7 +3,7 @@ server {
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
location / {
@@ -12,35 +12,6 @@ server {
proxy_send_timeout 30m;
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(<absolute url>, '_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/<token>/ 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.
#
# The context menu's "go to item" action, which search results and the
# tool views also offer, hardcodes the same new tab and is fixed too.
#
# Scoped to the two prefixes goToItem() builds, "files/" and
# "public/share/", so the window.open calls that download or preview a
# file (they go to api/resources/download) keep their own tab: sending
# an inline raw file to location.assign would replace the whole app.
# A link out of the add-on keeps its own tab as well, unless a user
# points a sidebar link (or a link inside a file open in the editor) at
# this same instance's files/ or public/share/ route, which then also
# opens in the panel. Same shape as the komga add-on's ingress filter.
#
# Injected into the page's existing nonce-carrying inline script rather
# than next to <div id="app">: FileBrowser sends
# script-src 'self' 'nonce-<random>', so a standalone inline <script>
# would be blocked. If upstream ever drops that
# window.__pwaDeferredPrompt line the filter simply stops matching and
# the popup behaviour returns, which is the pre-fix state.
sub_filter "window.__pwaDeferredPrompt = null;" "window.__pwaDeferredPrompt = null;(function(){var o=window.open;window.open=function(u,n,f){try{var b=(window.globalVars||{}).baseURL;if(u&&n==='_blank'&&!f&&b){if(b.slice(-1)!=='/')b+='/';var t=new URL(u,location.href);if((t.protocol==='http:'||t.protocol==='https:')&&t.origin===location.origin&&(t.pathname.indexOf(b+'files/')===0||t.pathname.indexOf(b+'public/share/')===0)){location.assign(t.href);return window}}}catch(e){}return o.apply(window,arguments)}})();";
}
}