Files
Psychotoxical-psysonic/src-tauri/capabilities/default.json
T
Psychotoxical 2cc3ab22f0 feat(themes): support local asset files in installed themes (#1345)
* feat(themes): support local asset files in installed themes

A theme can ship images and fonts in an assets/ folder and reference them with
a relative url("assets/…") instead of embedding everything as data: URIs.
Themes still never reach the network — a url() is a data: URI or a local
assets/ path, nothing else.

- themeAssets.ts mirrors the repo contract (path containment, extension
  whitelist, budgets, SVG content check) and rewrites url("assets/…") to an
  asset: URL at inject time, synchronously so it stays on the pre-paint path.
- Assets live under <appDataDir>/themes/<id>/assets/, served through the same
  asset protocol the cover cache uses. Store install fetches and writes them;
  zip import extracts them in Rust (capped, whitelisted, traversal-checked) and
  the frontend writes them through the same path. Uninstall removes the theme
  directory; a startup sweep clears orphans and self-heals a moved profile's
  asset base.
- The safety floor now accepts a relative assets/ url; a bundled asset that
  fails the contract aborts the install and cleans up.

No cache-busting query is appended to the asset URL: on Windows WebView2 the
asset protocol resolves the file path including a trailing ?v=…, turning a valid
asset into a 404. This matches the cover cache, which serves disk files with no
query. Verified end-to-end: a real asset theme's image loads (200) and renders.

* docs(changelog): note local theme assets (#1345)
2026-07-24 23:41:45 +02:00

49 lines
1.4 KiB
JSON

{
"$schema": "../gen/schemas/capability-schema.json",
"identifier": "default",
"description": "Default capabilities for Psysonic",
"platforms": ["linux", "macOS", "windows"],
"windows": ["main", "mini"],
"permissions": [
"core:default",
"shell:default",
{ "identifier": "shell:allow-open", "allow": [{ "url": "https://**" }] },
"global-shortcut:allow-register",
"global-shortcut:allow-unregister",
"store:default",
"store:allow-load",
"store:allow-set",
"store:allow-get",
"store:allow-save",
"dialog:default",
"dialog:allow-open",
"dialog:allow-save",
"fs:default",
"fs:allow-write-file",
"fs:allow-read-file",
"fs:allow-mkdir",
"fs:allow-remove",
"fs:allow-read-dir",
"fs:allow-app-write-recursive",
"fs:scope-download-recursive",
"fs:scope-home-recursive",
"window-state:allow-save-window-state",
"window-state:allow-restore-state",
"core:window:allow-set-title",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-toggle-maximize",
"core:window:allow-hide",
"core:window:allow-show",
"core:window:allow-set-fullscreen",
"core:window:allow-is-fullscreen",
"core:window:allow-start-dragging",
"core:window:allow-create",
"core:window:allow-set-size",
"core:webview:allow-create-webview-window",
"core:webview:allow-set-webview-zoom",
"process:allow-restart",
"updater:default"
]
}