Fix icon loading for third-party apps with file:// URL scheme

- Add file:// URL handling to AssetFilesInterface in kernel.cpp
- Update home.lua to use file:// prefix for absolute filesystem paths
- Add file:// URL handling to desktop file interface for consistency

This fixes RmlUi stripping the leading slash from absolute paths
when resolving img src URLs relative to the document base.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-19 17:01:31 +01:00
parent cb86d52705
commit 6b611b1d09
3 changed files with 26 additions and 6 deletions

View File

@@ -121,9 +121,14 @@ function renderThirdPartyApps()
else
icon_path = app.icon
end
-- Use file:// prefix for absolute paths to prevent RmlUi URL resolution
local src_path = icon_path
if icon_path:sub(1, 1) == "/" then
src_path = "file://" .. icon_path
end
-- Use img tag for actual icon
icon_html = '<img src="' .. icon_path .. '" style="width: 48px; height: 48px;"/>'
print("[Home] Loading icon: " .. icon_path)
icon_html = '<img src="' .. src_path .. '" style="width: 48px; height: 48px;"/>'
print("[Home] Loading icon: " .. src_path)
else
-- Fallback to initial letter
icon_html = '<span style="font-size: 28px; color: #000000;">' .. initial .. '</span>'